From 15bddabc5cbe0e751fadcaaa7f7c7c36bca61331 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 28 Jan 2020 19:25:20 +0100 Subject: eve logng press event added --- code/fe310/eos/timer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'code/fe310/eos/timer.c') diff --git a/code/fe310/eos/timer.c b/code/fe310/eos/timer.c index 9fd8d23..c629866 100644 --- a/code/fe310/eos/timer.c +++ b/code/fe310/eos/timer.c @@ -56,7 +56,7 @@ void eos_timer_init(void) { timer_next[i] = 0; timer_handler[i] = NULL; } - eos_evtq_set_handler(EOS_EVT_TIMER, timer_handler_evt); + eos_evtq_set_handler(EOS_EVT_TIMER, timer_handler_evt, 0); } void eos_timer_set_handler(unsigned char evt, eos_timer_fptr_t handler, uint8_t flags) { @@ -74,7 +74,11 @@ void eos_timer_set_handler(unsigned char evt, eos_timer_fptr_t handler, uint8_t timer_handler[evt] = handler; if (*mtimecmp != 0) set_csr(mie, MIP_MTIP); - if ((evt != EOS_TIMER_MAX_ETYPE) && flags) eos_evtq_set_flags(EOS_EVT_TIMER | evt + 1, flags); + if (evt != EOS_TIMER_MAX_ETYPE) eos_evtq_set_hflags(EOS_EVT_TIMER | evt + 1, flags); +} + +void eos_timer_set_hflags(unsigned char evt, uint8_t flags) { + if (evt && (evt < EOS_TIMER_MAX_ETYPE)) eos_evtq_set_hflags(EOS_EVT_TIMER | evt, flags); } uint64_t eos_timer_get(unsigned char evt) { -- cgit v1.2.3