Interrupts only Working if a hardware reset is made, There is propably an issue with the interrupt initialization or flag management. table size in imp_timer.c was too small

master
kerem yollu 2 years ago
parent 5e4725ef7b
commit 68de79e685

@ -92,7 +92,7 @@ void intEnableAll()
__enable_irq();
}
void intDissableAll()
void intDisableAll()
{
__disable_irq();
}

@ -6,7 +6,7 @@
// debug notes: the makro works. what seems to not work is the indexing and calling the handler!
static const uint32_t DIER_list[TIM16_UPDATE - TIM1_BREAK] = {
static const uint32_t DIER_list[41] = {
TIM_DIER_BIE,// timer 1
TIM_DIER_UIE,
TIM_DIER_TIE,

@ -23,7 +23,10 @@ int main(int argc, char *argv[])
setupInit(); // This is the sescond call of System init the assebly start code is calling it before the main.
//blinks 10 times to indicate the sicsessfull init if the device
intDisableAll();
intEnableAll();
//blinks 1 times to indicate the sicsessfull init if the device
for(i = 0 ; i < 10 ; i++) {
delayMs(50);
pinToggle(pinB3);
@ -31,7 +34,6 @@ int main(int argc, char *argv[])
}
pinWrite(pinB3, 0);
timerInitCounter(timer_2,(8E6/20E3)-1, 5000-1, upCounting);
//timerSetHz(timer_2, 1);

@ -0,0 +1,15 @@
#ifndef MAIN_H
#define MAIN_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifdef __cplusplus
}
#endif
#endif /* MAIN_H */

@ -24,11 +24,11 @@ extern "C" {
#include <stdlib.h>
#include "hwd_interrupt.h"
#define HANDLE_INT_FLAG(flagReg, flagMask, intType)\
do {if ((flagReg) & (flagMask)) {\
(flagReg) &= ~(flagMask);\
if(intHandlerArray[(intType)] == NULL) continue;\
intHandlerArray[(intType)]();\
#define HANDLE_INT_FLAG(flagReg, flagMask, intType) \
do {if ((flagReg) & (flagMask)) { \
(flagReg) &= ~(flagMask); \
if(intHandlerArray[(intType)] == NULL){ continue;} \
intHandlerArray[(intType)](); \
}} while (0)

Loading…
Cancel
Save