cleaner HAL usage

This commit is contained in:
rusefillc 2023-07-06 16:07:55 -04:00
parent 777c539cac
commit c2c5d5b01f
2 changed files with 12 additions and 6 deletions

View File

@ -33,6 +33,9 @@ void initWS2812()
[3] = {.mode = WS2812_TIM_CH == 3 ? PWM_OUTPUT_ACTIVE_HIGH : PWM_OUTPUT_DISABLED, .callback = NULL}, // Turn on the channel we care about
},
.cr2 = 0,
#if STM32_PWM_USE_ADVANCED
.bdtr = 0,
#endif
.dier = TIM_DIER_UDE, // DMA on update event for next period
};

View File

@ -193,17 +193,20 @@ public:
}
const PWMConfig pwmcfg = {
c_timerFrequency,
m_period,
nullptr,
{
.frequency = c_timerFrequency,
.period = m_period,
.callback = nullptr,
.channels = {
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
{PWM_OUTPUT_ACTIVE_HIGH, nullptr},
{PWM_OUTPUT_ACTIVE_HIGH, nullptr}
},
0,
0
.cr2 = 0,
#if STM32_PWM_USE_ADVANCED
.bdtr = 0,
#endif
.dier = 0,
};
// Start the timer running