PWM Done
This commit is contained in:
parent
f22d8aacd9
commit
c404ceeab2
1 changed files with 1 additions and 1 deletions
|
@ -42,5 +42,5 @@ void MyTimer_PWM( MyTimer_Struct_TypeDef * Timer, uint16_t cycle){
|
||||||
|
|
||||||
Timer->Timer->CCER |= TIM_CCER_CC1E; // Canal CH1 validé par bit CC1E (registre CCER)
|
Timer->Timer->CCER |= TIM_CCER_CC1E; // Canal CH1 validé par bit CC1E (registre CCER)
|
||||||
Timer->Timer->CR1 |= TIM_CR1_CEN; // Lancement du timer
|
Timer->Timer->CR1 |= TIM_CR1_CEN; // Lancement du timer
|
||||||
Timer->Timer->CCR1 = (cycle * Timer->ARR) / 100; // Fixer la durée à 20%
|
Timer->Timer->CCR1 = (cycle * Timer->ARR) / 100; // Fixer la durée à 20%
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue