mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-16 12:41:05 +00:00
use duetimer and fix bug where if the next state is the same the exit function would still get called
This commit is contained in:
@@ -60,9 +60,7 @@ void obd2_TC_init()
|
||||
TC0->TC_CHANNEL[0].TC_IDR = 0xFFFFFFFF;
|
||||
/* Clear status register by reading it*/
|
||||
TC0->TC_CHANNEL[0].TC_SR;
|
||||
|
||||
/* disable the quadrature decoder, to route the IO pins of TIOA and TIOB directly to the timer counter function (36.6.14.1) */
|
||||
// TC0->TC_BMR &= ~(TC_BMR_QDEN);
|
||||
|
||||
/* Set wave mode to UP mode with automatic trigger, select wave mode, set the clock to MCK / 2*/
|
||||
TC0->TC_CHANNEL[0].TC_CMR = TC_CMR_WAVSEL_UP_RC | TC_CMR_WAVE | TC_CMR_TCCLKS_TIMER_CLOCK1;
|
||||
/* Enable the RC Compare interrupt*/
|
||||
|
||||
Reference in New Issue
Block a user