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

cpu/sam3/periph_rtt: fix rtt_get_alarm()

Previously, the return value was off by one.
This commit is contained in:
Marian Buschsieweke 2021-03-30 14:49:11 +02:00
parent 49a5bfb9e5
commit d816666d84
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -75,7 +75,8 @@ void rtt_set_alarm(uint32_t alarm, rtt_cb_t cb, void *arg)
uint32_t rtt_get_alarm(void)
{
if (RTT->RTT_MR & RTT_MR_ALMIEN) {
return RTT->RTT_AR;
/* the alarm value is RTT_AR + 1, see rtt_set_alarm() */
return RTT->RTT_AR + 1;
}
return 0;
}