From d497339a5424b2d9e97a7454c0103a2159e5746a Mon Sep 17 00:00:00 2001 From: Amar Mahmutbegovic Date: Mon, 21 Oct 2024 06:22:21 +0200 Subject: [PATCH] cleanup --- Chapter12/cpp_hal/app/src/main_timer_peripheral.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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");