summaryrefslogtreecommitdiff
path: root/firmware/libc/gmtime.c (follow)
Commit message (Collapse)AuthorAge
* Improve code for gmtime_r()Michael Sevakis2017-02-03
| | | | | | | | | | | | Unlike the current code, it does no looping to count days or do table lookups, which means running time doesn't increase with year or month. A good thing if it's call a lot, especially if the algorithm were asked to compute dates centuries or more from the epoch start. As a bonus, handles negative time values. Change-Id: I198a23daf621e40623e6b44dacf2387078b4db9c
* Move intrinsic RTC implmentation differences to driver filesMichael Sevakis2017-01-26
| | | | | | | | | | | Some drivers set tm_wday just fine and do not need it coerced to be correct. Others set tm_yday, so don't overwrite what the driver sets; just zero it inside if it can't fill the field. Move calls to set_day_of_week() to the sorts of drivers that presumably required the hammer (FS#11814) in get_time() where the weekday isn't locked to the date. Change-Id: Idd0ded6bfc9d9f48fcc1a6074068164c42fcf24a
* gmtime: avoid a modulusRafaël Carré2012-03-18
| | | | | | since WEEK_SECONDS = 7 * DAY_SECONDS, the result is the same Change-Id: Iec161fc2de626c99c1aabf80ab1d3243eac602d9
* fix year calculation in gmtimeBertrik Sikken2012-03-12
| | | | Change-Id: I9a5f29ad73b5620096d38874c70351db9bd90062
* gmtime: reduce array size: days in month fit in 8 bitsRafaël Carré2012-03-11
| | | | Change-Id: Idcebdf0ae120cfc82a1f471d0553d23ca36d7eef
* Introduce gmtime.c and use it in the AS3514 RTC driverBertrik Sikken2012-03-11
Change-Id: I00a09ae28a68f8153fb8fa854fea741ddfb0bf09 Reviewed-on: http://gerrit.rockbox.org/175 Tested-by: Bertrik Sikken <bertrik@sikken.nl> Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Reviewed-by: Rafaël Carré <rafael.carre@gmail.com>