Crash if CTRL+C is pressed shortly after boot
I get this:
0x10017c62 in api_interrupt_trigger (id=id@entry=2) at ../epicardium/api/interrupt-sender.c:15
15 ;
(gdb) bt
#0 0x10017c62 in api_interrupt_trigger (id=id@entry=2) at ../epicardium/api/interrupt-sender.c:15
#1 0x10012b86 in serial_enqueue_char (chr=<optimized out>) at ../epicardium/modules/serial.c:106
#2 0x10012c14 in vSerialTask (pvParameters=<optimized out>) at ../epicardium/modules/serial.c:144
#3 0x1001ece4 in ?? () at ../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c:703
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) step
^C
Program received signal SIGINT, Interrupt.
api_interrupt_trigger (id=id@entry=2) at ../epicardium/api/interrupt-sender.c:15
15 ;
(gdb)
7 int api_interrupt_trigger(api_int_id_t id)
8 {
9 if (id >= EPIC_INT_NUM) {
10 return -EINVAL;
11 }
12
13 if (int_enabled[id]) {
14 while (API_CALL_MEM->int_id != (-1))
15 ;
16
17 API_CALL_MEM->int_id = id;
18 TMR_TO_Start(MXC_TMR5, 1, 0);
19 }
20 return 0;
21 }