Skip to content

Commit

Permalink
Merge pull request #585 from patryk3211/stm32f4x_pwm_config_fix
Browse files Browse the repository at this point in the history
Fixed PWM configuration macro for STM32 F4x family MCUs
  • Loading branch information
Paciente8159 committed Jan 14, 2024
2 parents f39bce7 + aa3a125 commit 2b9ccd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion uCNC/src/hal/mcus/stm32f4x/mcumap_stm32f4x.h
Original file line number Diff line number Diff line change
Expand Up @@ -3258,7 +3258,7 @@ extern bool tud_cdc_n_connected (uint8_t itf);
#define mcu_config_pwm(diopin, freq) \
{ \
RCC->AHB1ENR |= __indirect__(diopin, AHB1EN); \
PWM0_ENREG |= PWM0_APBEN; \
__indirect__(diopin, ENREG) |= __indirect__(diopin, APBEN); \
__indirect__(diopin, GPIO)->MODER &= ~(GPIO_RESET << ((__indirect__(diopin, BIT)) << 1)); /*reset dir*/ \
__indirect__(diopin, GPIO)->MODER |= (GPIO_AF << ((__indirect__(diopin, BIT)) << 1)); /*af mode*/ \
__indirect__(diopin, GPIO)->AFR[(__indirect__(diopin, BIT) >> 3)] &= ~(0xf << ((__indirect__(diopin, BIT) & 0x07) << 2)); \
Expand Down

0 comments on commit 2b9ccd7

Please sign in to comment.