Skip to main content
gingaz
Visitor II
April 15, 2013
Question

RTC Calendar manipulation

  • April 15, 2013
  • 2 replies
  • 752 views
Posted on April 15, 2013 at 03:04

Hello All,

I am writing a Scheduler which must handle long delays: from 1s to several days. What would be the easiest way to add, lets say, 10.000 seconds to the current Calendar time?

Is there any library to help me with the RTC_TimeTypeDef & RTC_DateTypeDef manipulation or do I have to handle this manually? I feel that manual date handling (and different day count in different months) is going to be time consuming and somewhat redundant.

Thanks,

Gintas

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    April 15, 2013
    Posted on April 15, 2013 at 03:54

    The F1 had a 32-bit second counter, and implemented time UNIX style.

    The F2/F4 have calendering, you'll have to perform time/date manipulation yourself. Not sure if it's redundant, as there is no direct support that's being replaced. If you're doing such work you should have tools, and routines already validated for such tasks.

    Cross posted on Keil forum.

    http://www.keil.com/forum/22853/

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John F.
    Associate III
    April 15, 2013
    Posted on April 15, 2013 at 10:10

    If you don't need the timer to be battery backed, why not just set up any one of the microcontroller's timers as a one second (100ms / 10ms) counter and use ''linear'' time?