|
|
|
@ -1,12 +1,17 @@
|
|
|
|
|
#include "interrupt.h"
|
|
|
|
|
static void defaultHandler(){};
|
|
|
|
|
|
|
|
|
|
// pointers to dedicated interrupt handlers
|
|
|
|
|
|
|
|
|
|
void intInit(
|
|
|
|
|
intType_t intType
|
|
|
|
|
intHandler_t handler,
|
|
|
|
|
uint8_t priority)
|
|
|
|
|
{
|
|
|
|
|
NVIC_SetPriority(, priority);
|
|
|
|
|
NVIC_SetPriority(interruptTypeIndexList[intType], priority);
|
|
|
|
|
|
|
|
|
|
// TODO: add index ceck!
|
|
|
|
|
intHandlerList[intType] = handler;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void intEnableAll()
|
|
|
|
@ -35,10 +40,47 @@ void intDissable(
|
|
|
|
|
|
|
|
|
|
void TIM2_IRQHandler()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(TIM2->SR & TIM_SR_UIF) {
|
|
|
|
|
// clear flag
|
|
|
|
|
TIM2-> SR &= ~TIM_SR_UIF;
|
|
|
|
|
|
|
|
|
|
//TODO: call handler here
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC1IF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC12IF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC3IF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC4IF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_TIF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC1OF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC2OF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC3OF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(TIM->SR & TIM_SR_CC4OF) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|