mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-15 04:01:04 +00:00
Update obd2_timer.c, add comment about clearing status register
added reference to datasheet section 13.4
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user