You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
627 B
41 lines
627 B
#include "interrupt.h"
|
|
#include "hwd_interrupt.h"
|
|
|
|
static void defaultHandler(){};
|
|
|
|
// pointers to dedicated interrupt handlers
|
|
|
|
void intInit(
|
|
intrType_t intType,
|
|
intHandler_t handler,
|
|
uint8_t priority)
|
|
{
|
|
NVIC_SetPriority(interruptTypeIndexList[intType], priority);
|
|
|
|
// TODO: add index ceck!
|
|
intHandlerList[intType] = (uint32_t)handler;
|
|
}
|
|
|
|
void intEnableAll()
|
|
{
|
|
__enable_irq();
|
|
}
|
|
|
|
void intDissableAll()
|
|
{
|
|
__disable_irq();
|
|
}
|
|
|
|
void intEnable(
|
|
intrType_t intType)
|
|
{
|
|
NVIC_EnableIRQ(interruptTypeIndexList[intType]);
|
|
}
|
|
|
|
void intDissable(
|
|
intrType_t intType)
|
|
{
|
|
NVIC_DisableIRQ(interruptTypeIndexList[intType]);
|
|
}
|
|
|