aboutsummaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-24 17:14:32 -0700
committerChristian Cunningham <cc@localhost>2022-03-24 17:14:32 -0700
commit78493b1d441ef888910cf958a16f260bc3c1a7bd (patch)
tree3df0bd30040af43b5e4072eb3730fafe8a952167 /usr
parentc5f8eb6c35f6b3ca14c2a0e916fa835ed85cdfd6 (diff)
Subscriibe w/ More Info
Diffstat (limited to 'usr')
-rw-r--r--usr/main.c25
1 files changed, 19 insertions, 6 deletions
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);
}