diff --git a/due_obd2/obd2_timer.c b/due_obd2/obd2_timer.c index 4f5b5c6..d5d7f67 100644 --- a/due_obd2/obd2_timer.c +++ b/due_obd2/obd2_timer.c @@ -20,7 +20,9 @@ void obd2_timer_reset() */ /* disable interrupts */ RTT->RTT_MR &= ~RTT_MR_ALMIEN; - /* clear the status register */ + /* clear the status register (reading it clears it) + SAM3X datasheet section 13.4: Reading the RTT_SR status register resets the RTTINC and ALMS fields. + */ RTT->RTT_SR; /* set the alarm value to 0*/ RTT->RTT_AR = 0; @@ -29,4 +31,4 @@ void obd2_timer_reset() /* reset the RTT*/ RTT->RTT_MR |= RTT_MR_RTTRST; -} \ No newline at end of file +}