Using CMSIS NVIC functions to set custom timer interrupt handler.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Ladon
Date:
Fri Aug 02 06:03:16 2019 +0000
Parent:
6:be045fed855f
Commit message:
Made more cpp friendly.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r be045fed855f -r d93dcab712f1 main.cpp
--- 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.
     // -