From 6b731d6f5d90c427a6c2e95257cb43d1eff5d930 Mon Sep 17 00:00:00 2001 From: travis-farmer Date: Tue, 7 Nov 2023 13:12:33 -0500 Subject: [PATCH] fixed timers, still only two tracks --- DCCTimerGiga.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DCCTimerGiga.cpp b/DCCTimerGiga.cpp index 6b1dd38..3217528 100644 --- a/DCCTimerGiga.cpp +++ b/DCCTimerGiga.cpp @@ -45,8 +45,8 @@ INTERRUPT_CALLBACK interruptHandler=0; //HardwareTimer* timer = NULL; //HardwareTimer* timerAux = NULL; -HardwareTimer timer(TIM2); -HardwareTimer timerAux(TIM3); +HardwareTimer timer(TIM3); +HardwareTimer timerAux(TIM2); static bool tim2ModeHA = false; static bool tim3ModeHA = false; @@ -97,9 +97,9 @@ void DCCTimer::setPWM(byte pin, bool high) { tim3ModeHA = true; } if (high) - TIM2->CCMR1 = (TIM2->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_0; + TIM3->CCMR1 = (TIM3->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_0; else - TIM2->CCMR1 = (TIM2->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_1; + TIM3->CCMR1 = (TIM3->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_1; break; case 13: if (!tim2ModeHA) { @@ -107,9 +107,9 @@ void DCCTimer::setPWM(byte pin, bool high) { tim2ModeHA = true; } if (high) - TIM3->CCMR1 = (TIM3->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_0; + TIM2->CCMR1 = (TIM2->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_0; else - TIM3->CCMR1 = (TIM3->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_1; + TIM2->CCMR1 = (TIM2->CCMR1 & ~TIM_CCMR1_OC1M_Msk) | TIM_CCMR1_OC1M_1; break; } }