From c5f8eb6c35f6b3ca14c2a0e916fa835ed85cdfd6 Mon Sep 17 00:00:00 2001
From: Christian Cunningham <cc@localhost>
Date: Thu, 24 Mar 2022 17:06:55 -0700
Subject: Unsubscribe example

---
 usr/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/usr/main.c b/usr/main.c
index 5a49f49..1743c33 100644
--- a/usr/main.c
+++ b/usr/main.c
@@ -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;
-- 
cgit v1.2.1