parent
3e9b0d7cb8
commit
15c0f36e11
@ -0,0 +1,44 @@
|
||||
#include "interrupt.h"
|
||||
|
||||
void intInit(
|
||||
intType_t intType
|
||||
intHandler_t handler,
|
||||
uint8_t priority)
|
||||
{
|
||||
NVIC_SetPriority(, priority);
|
||||
|
||||
}
|
||||
|
||||
void intEnableAll()
|
||||
{
|
||||
__enable_irq();
|
||||
}
|
||||
|
||||
void intDissableAll()
|
||||
{
|
||||
__disable_irq();
|
||||
}
|
||||
|
||||
void intEnable(
|
||||
intType_t intType)
|
||||
{
|
||||
NVIC_EnableIRQ();
|
||||
}
|
||||
|
||||
void intDissable(
|
||||
intType_t intType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Interrupt service routines
|
||||
|
||||
void TIM2_IRQHandler()
|
||||
{
|
||||
if(TIM2->SR & TIM_SR_UIF) {
|
||||
// clear flag
|
||||
TIM2-> SR &= ~TIM_SR_UIF;
|
||||
|
||||
//TODO: call handler here
|
||||
}
|
||||
}
|
Loading…
Reference in new issue