diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-01-28 19:25:20 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-01-28 19:25:20 +0100 |
commit | 15bddabc5cbe0e751fadcaaa7f7c7c36bca61331 (patch) | |
tree | f1c1351a9ed0acb426914ee92cd7b2b917fd9ee4 /code/fe310/eos/net.c | |
parent | 445d72abf487dc325ccbde1e3a12d1c4cf695a6a (diff) |
eve logng press event added
Diffstat (limited to 'code/fe310/eos/net.c')
-rw-r--r-- | code/fe310/eos/net.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/code/fe310/eos/net.c b/code/fe310/eos/net.c index 2285ef7..36695bc 100644 --- a/code/fe310/eos/net.c +++ b/code/fe310/eos/net.c @@ -204,7 +204,7 @@ void eos_net_init(void) { for (i=0; i<EOS_NET_MAX_MTYPE; i++) { evt_handler[i] = eos_evtq_bad_handler; } - eos_evtq_set_handler(EOS_EVT_NET, net_handler_evt); + eos_evtq_set_handler(EOS_EVT_NET, net_handler_evt, 0); GPIO_REG(GPIO_INPUT_EN) |= (1 << NET_PIN_CTS); GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << NET_PIN_CTS); @@ -266,9 +266,11 @@ void _eos_net_handle(unsigned char type, unsigned char *buffer, uint16_t len, un if (buf_free && buf_acq) eos_net_release(); } -void _eos_net_set_handler(unsigned char idx, eos_evt_fptr_t handler, eos_evt_fptr_t handlers[], uint16_t flags, uint16_t *flags_buf_free, uint16_t *flags_buf_acq) { +void _eos_net_set_handler(unsigned char idx, eos_evt_fptr_t handler, eos_evt_fptr_t handlers[], uint8_t flags, uint16_t *flags_buf_free, uint16_t *flags_buf_acq) { if (flags) { uint16_t flag = (uint16_t)1 << idx; + *flags_buf_free &= ~flag; + *flags_buf_acq &= ~flag; if (flags & EOS_NET_FLAG_BFREE) *flags_buf_free |= flag; if (flags & EOS_NET_FLAG_BACQ) *flags_buf_acq |= flag; } |