diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-05-13 12:26:19 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-05-13 12:26:19 +0200 |
commit | 9ccb4db8d59ec9dab33ee8617d462f21a8bb4fa8 (patch) | |
tree | a4f8ba9375a4ee82bae6ddc0cb3a35227f6f9469 /fw/fe310/eos/event.c | |
parent | 45f0d9b890b086493f9bb06428c46cd802324223 (diff) |
touch controller/eve fixes
Diffstat (limited to 'fw/fe310/eos/event.c')
-rw-r--r-- | fw/fe310/eos/event.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/fw/fe310/eos/event.c b/fw/fe310/eos/event.c index 753cdb4..f76384a 100644 --- a/fw/fe310/eos/event.c +++ b/fw/fe310/eos/event.c @@ -121,22 +121,28 @@ void eos_evtq_flush_isr(void) { } void eos_evtq_loop(void) { + int foo = 1; + + while(foo) { + eos_evtq_exec(); + } +} + +void eos_evtq_exec(void) { unsigned char type; unsigned char *buffer; uint16_t len; - int foo = 1; - while(foo) { - clear_csr(mstatus, MSTATUS_MIE); - eos_msgq_pop(&_eos_event_q, &type, &buffer, &len); - if (type) { - set_csr(mstatus, MSTATUS_MIE); - evt_handler[0](type, buffer, len); - } else { - asm volatile ("wfi"); - set_csr(mstatus, MSTATUS_MIE); - } + clear_csr(mstatus, MSTATUS_MIE); + eos_msgq_pop(&_eos_event_q, &type, &buffer, &len); + if (type) { + set_csr(mstatus, MSTATUS_MIE); + evt_handler[0](type, buffer, len); + } else { + asm volatile ("wfi"); + set_csr(mstatus, MSTATUS_MIE); } + } void eos_evtq_bad_handler(unsigned char type, unsigned char *buffer, uint16_t len) { |