From 78493b1d441ef888910cf958a16f260bc3c1a7bd Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 24 Mar 2022 17:14:32 -0700 Subject: Subscriibe w/ More Info --- usr/main.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'usr') diff --git a/usr/main.c b/usr/main.c index 1743c33..b6cfee3 100644 --- a/usr/main.c +++ b/usr/main.c @@ -75,13 +75,26 @@ void loopt(void) unsubscribe_irq(SYS_TIMER_0_IRQ); } -static unsigned long TICK_RATE_0 = 5000000; -static unsigned long TICK_RATE_1 = 300000; -static unsigned long UART_PRIORITY = 2; +static struct SysTimerInfo stime_0 = { + .tick_rate = 5000000, + .priority = 0, + .arg = 0, +}; + +static struct SysTimerInfo stime_1 = { + .tick_rate = 300000, + .priority = 0, + .arg = 0, +}; + +static struct UartInfo UART_INFO = { + .priority = 2, +}; + void main(void) { - subscribe_irq(UART_IRQ, handle_data, &UART_PRIORITY); - subscribe_irq(SYS_TIMER_0_IRQ, loopt, &TICK_RATE_0); - subscribe_irq(SYS_TIMER_1_IRQ, loopt, &TICK_RATE_1); + subscribe_irq(UART_IRQ, handle_data, &UART_INFO); + subscribe_irq(SYS_TIMER_0_IRQ, loopt, &stime_0); + subscribe_irq(SYS_TIMER_1_IRQ, loopt, &stime_1); add_thread(loop, 0, 0); } -- cgit v1.2.1