Spyros Papanastasiou
/
General_purpose_timer_TIM2__custom_interrupt_handler
Using CMSIS NVIC functions to set custom timer interrupt handler.
Diff: main.cpp
- Revision:
- 7:d93dcab712f1
- Parent:
- 6:be045fed855f
--- a/main.cpp Fri Aug 02 05:59:09 2019 +0000 +++ b/main.cpp Fri Aug 02 06:03:16 2019 +0000 @@ -109,7 +109,7 @@ inline void interrupt_enable () { // NVIC_SetPriority(TIM2_IRQn, 250); - NVIC_SetVector(TIM2_IRQn, (uint32_t) interrupt_handler); + NVIC_SetVector(TIM2_IRQn, reinterpret_cast<uint32_t>(interrupt_handler)); NVIC_EnableIRQ(TIM2_IRQn); // ^Definition of NVIC_SetVector() : https://arm-software.github.io/CMSIS_5/Core/html/group__NVIC__gr.html#gab43c1c59d5c081f1bc725237f4b1f916. // -