aboutsummaryrefslogtreecommitdiff
path: root/usr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/main.c')
-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);
}