diff options
author | Christian Cunningham <cc@localhost> | 2022-03-24 17:06:55 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-24 17:06:55 -0700 |
commit | c5f8eb6c35f6b3ca14c2a0e916fa835ed85cdfd6 (patch) | |
tree | 45fb49c0e82fbc48edd83b11a86b56206c6350c6 | |
parent | d7b3c5bdc5d59b908e1835839c124d6463a5f1e0 (diff) |
Unsubscribe example
-rw-r--r-- | usr/main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -66,7 +66,13 @@ void loop(void) void loopt(void) { static char str[13]; + static char cnt = 18; draw_string(0, 14, ulong_to_string(*(volatile unsigned long*)SYS_TIMER_CHI, str)); + cnt--; + if (cnt == 2) + unsubscribe_irq(SYS_TIMER_1_IRQ); + if (cnt == 0) + unsubscribe_irq(SYS_TIMER_0_IRQ); } static unsigned long TICK_RATE_0 = 5000000; |