work on interrupts

master
polymurph 2 years ago
parent 9233133f35
commit 409349c3d4

@ -21,6 +21,7 @@ extern "C" {
#include "stm32f042x6.h" #include "stm32f042x6.h"
#include <stdint.h> #include <stdint.h>
#include "hwd_interrupt.h"
/*! interrupt types. These act as indexes for the */ /*! interrupt types. These act as indexes for the */
typedef enum { typedef enum {

@ -66,35 +66,42 @@ void TIM2_IRQHandler()
if(TIM2->SR & TIM_SR_CC3IF) { if(TIM2->SR & TIM_SR_CC3IF) {
TIM2-> SR &= ~TIM_SR_CC3IF; TIM2-> SR &= ~TIM_SR_CC3IF;
((intHandler_t)(intHandlerList[TIM2_CONTERCOMPARE_3]))();
} }
if(TIM2->SR & TIM_SR_CC4IF) { if(TIM2->SR & TIM_SR_CC4IF) {
TIM2-> SR &= ~TIM_SR_CC4IF; TIM2-> SR &= ~TIM_SR_CC4IF;
((intHandler_t)(intHandlerList[TIM2_CONTERCOMPARE_4]))();
} }
if(TIM2->SR & TIM_SR_TIF) { if(TIM2->SR & TIM_SR_TIF) {
TIM2-> SR &= ~TIM_SR_TIF; TIM2-> SR &= ~TIM_SR_TIF;
((intHandler_t)(intHandlerList[TIM2_TRIGGER]))();
} }
if(TIM2->SR & TIM_SR_CC1OF) { if(TIM2->SR & TIM_SR_CC1OF) {
TIM2-> SR &= ~TIM_SR_CC1OF; TIM2-> SR &= ~TIM_SR_CC1OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_1]))();
} }
if(TIM2->SR & TIM_SR_CC2OF) { if(TIM2->SR & TIM_SR_CC2OF) {
TIM2-> SR &= ~TIM_SR_CC2OF; TIM2-> SR &= ~TIM_SR_CC2OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_2]))();
} }
if(TIM2->SR & TIM_SR_CC3OF) { if(TIM2->SR & TIM_SR_CC3OF) {
TIM2-> SR &= ~TIM_SR_CC3OF; TIM2-> SR &= ~TIM_SR_CC3OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMPARE_3]))();
} }
if(TIM2->SR & TIM_SR_CC4OF) { if(TIM2->SR & TIM_SR_CC4OF) {
TIM2-> SR &= ~TIM_SR_CC4OF; TIM2-> SR &= ~TIM_SR_CC4OF;
((intHandler_t)(intHandlerList[TIM2_CAPTURECOMAPRE_4]))();
} }
} }

Loading…
Cancel
Save