Verified Commit 941fb5c4 authored by Rahix's avatar Rahix
Browse files

fix(api): Change interrupt idle value to -1



Previously 0 was used but as 0 is also the ID of the reset interrupt,
this could lead to weird behaviors.
Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent b8940bcd
......@@ -231,6 +231,9 @@ void __dispatch_isr(api_int_id_t id)
f_client.write(tmp.format(**isr))
tmp = """\
case (-1):
/* Ignore a spurious interrupt */
break;
default:
epic_isr_default_handler(id);
break;
......
......@@ -10,5 +10,5 @@ void TMR5_IRQHandler(void)
{
TMR_IntClear(MXC_TMR5);
__dispatch_isr(API_CALL_MEM->int_id);
API_CALL_MEM->int_id = 0;
API_CALL_MEM->int_id = (-1);
}
......@@ -11,8 +11,9 @@ int api_interrupt_trigger(api_int_id_t id)
}
if (int_enabled[id]) {
while (API_CALL_MEM->int_id)
while (API_CALL_MEM->int_id != (-1))
;
API_CALL_MEM->int_id = id;
TMR_TO_Start(MXC_TMR5, 1, 0);
}
......@@ -21,7 +22,7 @@ int api_interrupt_trigger(api_int_id_t id)
void api_interrupt_init(void)
{
API_CALL_MEM->int_id = 0;
API_CALL_MEM->int_id = (-1);
for (int i = 0; i < EPIC_INT_NUM; i++) {
int_enabled[i] = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment