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/timer.c | |
parent | 445d72abf487dc325ccbde1e3a12d1c4cf695a6a (diff) |
eve logng press event added
Diffstat (limited to 'code/fe310/eos/timer.c')
-rw-r--r-- | code/fe310/eos/timer.c | 8 |
1 files changed, 6 insertions, 2 deletions
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) { |