From 46b08fc235f3f068034355970697acc0956e5c99 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 7 Jan 2026 22:58:33 +0100 Subject: introduced EOSMessage struct for SPI and Event queue messages; added APP <-> FE310 bridge SPI messages; LCD/touch panel driver for app module; save relevant state to AON module before sleep; --- fw/fe310/eos/soc/timer.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'fw/fe310/eos/soc/timer.c') diff --git a/fw/fe310/eos/soc/timer.c b/fw/fe310/eos/soc/timer.c index 0573e84..f26f601 100644 --- a/fw/fe310/eos/soc/timer.c +++ b/fw/fe310/eos/soc/timer.c @@ -5,23 +5,22 @@ #include "platform.h" #include "eos.h" -#include "msgq.h" #include "event.h" #include "timer.h" #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) #define MAX(X, Y) (((X) > (Y)) ? (X) : (Y)) -static eos_timer_handler_t timer_handler[EOS_TIMER_MAX_ETYPE + 1]; +static eos_evt_simple_handler_t timer_handler[EOS_TIMER_MAX_ETYPE + 1]; static uint64_t timer_next[EOS_TIMER_MAX_ETYPE + 1]; -static void timer_handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) { - unsigned char idx = (type & ~EOS_EVT_MASK); +static void timer_handle_evt(unsigned char type, EOSMessage *msg, uint16_t len) { + unsigned char idx = type & ~EOS_EVT_MASK; if (idx && (idx <= EOS_TIMER_MAX_ETYPE) && timer_handler[idx]) { - timer_handler[idx](type); + timer_handler[idx](type & ~EOS_EVT_MASK); } else { - eos_evtq_bad_handler(type, buffer, len); + eos_evtq_bad_handler(type, msg, len); } } @@ -63,7 +62,7 @@ int eos_timer_init(void) { return EOS_OK; } -void eos_timer_set_handler(unsigned char evt, eos_timer_handler_t handler) { +void eos_timer_set_handler(unsigned char evt, eos_evt_simple_handler_t handler) { uint64_t *mtimecmp = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIMECMP); if (!evt && (*mtimecmp != 0)) clear_csr(mie, MIP_MTIP); -- cgit v1.2.3