From df5fe51a621e0bdc6ccaceb902746ddc2eb0099a Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Tue, 21 Mar 2023 23:28:20 +0100 Subject: [PATCH] Added Start and Stop macros for PWM. Init no longer enable the MOE bit --- ProjetsKEIL/Drivers/timerdriver.c | 1 - ProjetsKEIL/Drivers/timerdriver.h | 2 ++ ProjetsKEIL/timer_interruption/Source/Principale.c | 1 + ProjetsKEIL/timer_interruption/timer_interruption.uvoptx | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ProjetsKEIL/Drivers/timerdriver.c b/ProjetsKEIL/Drivers/timerdriver.c index 09b982a..ee3c198 100644 --- a/ProjetsKEIL/Drivers/timerdriver.c +++ b/ProjetsKEIL/Drivers/timerdriver.c @@ -50,7 +50,6 @@ void MyTimer_PWM_Init(MyPWM_Struct_TypeDef * PWM) PWM->Timer->CCR1 = PWM->CCR; break; } - PWM->Timer->BDTR |= (1<Timer->CCER |= (1<<4*(PWM->channel-1)); //enable capture/compare registers } diff --git a/ProjetsKEIL/Drivers/timerdriver.h b/ProjetsKEIL/Drivers/timerdriver.h index 2bbc66c..ccbcc95 100644 --- a/ProjetsKEIL/Drivers/timerdriver.h +++ b/ProjetsKEIL/Drivers/timerdriver.h @@ -31,5 +31,7 @@ void MyTimer_PWM_Init(MyPWM_Struct_TypeDef * PWM); #define MyTimer_Base_Start(Timer) (Timer->CR1 |= (0x01<CR1 &= ~(0x01<BDTR |= (1<BDTR &= ~(1<CCMR1 |= (0x6<<12); //TIM2->BDTR |= (1<CCR2 = 10; diff --git a/ProjetsKEIL/timer_interruption/timer_interruption.uvoptx b/ProjetsKEIL/timer_interruption/timer_interruption.uvoptx index bc4e426..519fefc 100644 --- a/ProjetsKEIL/timer_interruption/timer_interruption.uvoptx +++ b/ProjetsKEIL/timer_interruption/timer_interruption.uvoptx @@ -125,7 +125,7 @@ 0 DLGDARM - (1010=895,198,1271,755,1)(1007=105,137,292,412,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=498,100,919,527,1)(121=491,538,912,965,1)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=105,137,504,482,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=1175,164,1769,915,1)(132=150,186,744,937,0)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) + (1010=895,198,1271,755,1)(1007=105,137,292,412,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(100=-1,-1,-1,-1,0)(110=-1,-1,-1,-1,0)(111=-1,-1,-1,-1,0)(1011=-1,-1,-1,-1,0)(180=-1,-1,-1,-1,0)(120=498,100,919,527,1)(121=491,538,912,965,1)(122=875,109,1296,536,0)(123=-1,-1,-1,-1,0)(140=-1,-1,-1,-1,0)(240=105,137,504,482,0)(190=-1,-1,-1,-1,0)(200=-1,-1,-1,-1,0)(170=-1,-1,-1,-1,0)(130=-1,-1,-1,-1,0)(131=1175,164,1769,915,1)(132=1172,171,1766,922,1)(133=-1,-1,-1,-1,0)(160=-1,-1,-1,-1,0)(161=-1,-1,-1,-1,0)(162=-1,-1,-1,-1,0)(210=-1,-1,-1,-1,0)(211=-1,-1,-1,-1,0)(220=-1,-1,-1,-1,0)(221=-1,-1,-1,-1,0)(230=-1,-1,-1,-1,0)(234=-1,-1,-1,-1,0)(231=-1,-1,-1,-1,0)(232=-1,-1,-1,-1,0)(233=-1,-1,-1,-1,0)(150=-1,-1,-1,-1,0)(151=-1,-1,-1,-1,0) 0