diff --git a/Chapter12/cpp_hal/app/src/main_timer_peripheral.cpp b/Chapter12/cpp_hal/app/src/main_timer_peripheral.cpp index 62b59f0..3c4a3f0 100644 --- a/Chapter12/cpp_hal/app/src/main_timer_peripheral.cpp +++ b/Chapter12/cpp_hal/app/src/main_timer_peripheral.cpp @@ -66,7 +66,7 @@ struct timer { using cr1 = reg; using dier = reg; using sr = reg; - using psc = reg; + using psc = reg; using arr = reg; template @@ -130,20 +130,18 @@ struct timer { using timer2 = timer; using timer3 = timer; -// Timer interrupt handler extern "C" void TIM2_IRQHandler(void) { - if (timer2::sr::read() & TIM_SR_UIF) // Check if update interrupt flag is set + if (timer2::sr::read() & TIM_SR_UIF) { timer2::sr::set(timer2::uif::value::disable); printf("TIM2 IRQ..\r\n"); } } -// Timer interrupt handler extern "C" void TIM3_IRQHandler(void) { - if (timer3::sr::read() & TIM_SR_UIF) // Check if update interrupt flag is set + if (timer3::sr::read() & TIM_SR_UIF) { timer3::sr::set(timer3::uif::value::disable); printf("TIM3 IRQ..\r\n");