1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/rtt_rtc: fix of the second alignment problem

To avoid that `SECONDS(now)` can have the same value in two subsequent RTT cycles, the difference of `2^32 - TICKS(RTT_SECOND_MAX)` has to be larger than one second `TICKS(1)`.
This commit is contained in:
Gunar Schorcht 2020-04-15 10:24:49 +02:00
parent c68475eb0d
commit 665214e6b4

View File

@ -36,7 +36,7 @@
#define _RTT(n) ((n) & RTT_MAX_VALUE)
#define RTT_SECOND_MAX (RTT_MAX_VALUE/RTT_FREQUENCY)
#define RTT_SECOND_MAX ((RTT_MAX_VALUE/RTT_FREQUENCY) - 1)
#define TICKS(x) ( (x) * RTT_SECOND)
#define SECONDS(x) (_RTT(x) / RTT_SECOND)