From 85500fe0d01b691a9bdd8c2330d26d66bc2bc177 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 18 Oct 2019 18:38:00 +0200 Subject: added spi driver --- code/fe310/eos/event.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'code/fe310/eos/event.c') diff --git a/code/fe310/eos/event.c b/code/fe310/eos/event.c index 25a4feb..bae110e 100644 --- a/code/fe310/eos/event.c +++ b/code/fe310/eos/event.c @@ -1,5 +1,5 @@ +#include #include -#include #include #include "encoding.h" @@ -20,7 +20,7 @@ static volatile char evt_busy = 0; void eos_evtq_init(void) { int i; - + for (i=0; i> 4) - 1; uint16_t flag = (uint16_t)1 << ((type & ~EOS_EVT_MASK) - 1); int ok; - + ok = eos_net_acquire(evt_handler_wrapper_acq[idx] & flag); if (ok) { evt_handler[idx](type, buffer, len); @@ -63,7 +63,7 @@ static void evtq_handler_wrapper(unsigned char type, unsigned char *buffer, uint static void evtq_handler(unsigned char type, unsigned char *buffer, uint16_t len) { unsigned char idx = ((type & EOS_EVT_MASK) >> 4) - 1; uint16_t flag = (uint16_t)1 << ((type & ~EOS_EVT_MASK) - 1); - + if (idx >= EOS_EVT_MAX_EVT) { eos_evtq_bad_handler(type, buffer, len); return; @@ -77,7 +77,7 @@ static void evtq_handler(unsigned char type, unsigned char *buffer, uint16_t len void eos_evtq_set_handler(unsigned char type, eos_evt_fptr_t handler) { unsigned char idx = ((type & EOS_EVT_MASK) >> 4) - 1; - + if (idx < EOS_EVT_MAX_EVT) evt_handler[idx] = handler; } -- cgit v1.2.3