Controlling PWM of LED through direct access of TIM2 timer's registers.

Dependencies:   mbed

Revision:
6:be045fed855f
Parent:
5:3ee6e0113b41
Child:
7:d93dcab712f1
--- a/main.cpp	Fri Aug 02 05:19:08 2019 +0000
+++ b/main.cpp	Fri Aug 02 05:59:09 2019 +0000
@@ -109,8 +109,8 @@
 inline void interrupt_enable ()
 {
 //    NVIC_SetPriority(TIM2_IRQn, 250);
+    NVIC_SetVector(TIM2_IRQn, (uint32_t) interrupt_handler);
     NVIC_EnableIRQ(TIM2_IRQn);
-    NVIC_SetVector(TIM2_IRQn, (uint32_t) interrupt_handler);
     // ^Definition of NVIC_SetVector() : https://arm-software.github.io/CMSIS_5/Core/html/group__NVIC__gr.html#gab43c1c59d5c081f1bc725237f4b1f916.
     // -
 }