Commit Graph

6 Commits (97cb833afd3639bd8145902b6911f732d7ca50a0)

Author SHA1 Message Date
Martin Kojtal ffcb6ecfb5 platform: astyle update 2018-06-29 10:38:44 +01:00
Przemyslaw Stekiel dc5a66dc5c Add support for extended RTC.
Provide support to use whole 32-bit range (unsigned int) to hold time since UNIX epoch.
The suppoerted time range is now from the 1st of January 1970 at 00:00:00 to the 7th of February 2106 at 06:28:15.
Add support for two types of RTC devices:
- RTCs which handles all leap years in the mentioned year range correctly. Leap year is determined by checking if the year counter value is divisible by 400, 100, and 4.
- RTCs which handles leap years correctly up to 2100. The RTC does a simple bit comparison to see if the two lowest order bits of the year counter are zero. In this case 2100 year will be considered incorrectly as a leap year, so the last valid point in time will be 28.02.2100 23:59:59 and next day will be 29.02.2100 (invalid). So after 28.02.2100 the day counter will be off by a day.
2017-12-01 17:07:34 +01:00
Deepika 9b5f5a5472 Typecasting to resolve warning: integer conversion resulted in a change of sign 2017-06-15 13:37:19 -05:00
Vincent Coubard 6b020a3510 mbed_localtime: Add support of year day.
This field is needed by the LPC43XX targets.
2017-06-08 10:32:57 +01:00
Vincent Coubard 01f1e08358 mbed_localtime: Add support of wday.
This field is necessary, it is used by several vendor RTC: Atmel, ST, NUVOTON,
NXP.
2017-06-08 10:11:01 +01:00
Vincent Coubard f880e44145 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-07 22:06:22 -05:00