Finish testing stage
This commit is contained in:
@@ -56,6 +56,9 @@ void Timer::init(uint32_t prescaler, uint32_t autoReload) {
|
||||
|
||||
setPrescaler(prescaler);
|
||||
setARR(autoReload);
|
||||
|
||||
*getTimerStatusRegister(m_key).reg = 0;
|
||||
*getTimerDMAInterruptEnableRegister(m_key).reg = 0;
|
||||
}
|
||||
|
||||
void Timer::setPWMMode(SHAL_Timer_Channel channel, SHAL_TIM_Output_Compare_Mode outputCompareMode, SHAL_Timer_Channel_Main_Output_Mode mainOutputMode,
|
||||
@@ -89,6 +92,7 @@ void Timer::setPWMMode(SHAL_Timer_Channel channel, SHAL_TIM_Output_Compare_Mode
|
||||
|
||||
SHAL_set_bits(ccer.reg, 4, fullChannelModeMask, offset);
|
||||
SHAL_apply_bitmask(bdtr.reg, bdtr.main_output_enable_mask);
|
||||
|
||||
}
|
||||
|
||||
void Timer::setPWMDutyCycle(uint32_t dutyCycle) {
|
||||
|
||||
@@ -8,8 +8,8 @@ DEFINE_TIMER_IRQ(Timer_Key::S_TIM1, TIM1_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM2, TIM2_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM6, TIM6_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM7, TIM7_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM15, TIM15_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM16, TIM16_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM15, TIM1_BRK_TIM15_IRQHandler)
|
||||
DEFINE_TIMER_IRQ(Timer_Key::S_TIM16, TIM1_UP_TIM16_IRQHandler)
|
||||
|
||||
void registerTimerCallback(Timer_Key key, TimerCallback callback){
|
||||
timer_callbacks[static_cast<uint32_t>(key)] = callback;
|
||||
|
||||
Reference in New Issue
Block a user