aboutsummaryrefslogtreecommitdiff
path: root/src/sys/timer.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2021-12-04 17:28:16 -0700
committerChristian Cunningham <cc@localhost>2021-12-04 17:28:16 -0700
commit709148a4252c6d608808d9ed1380b02e94173d1b (patch)
tree5da3abd1020476cf3964cc10691546ce059108a4 /src/sys/timer.c
parent1c6cd8e1ea53275cc44b2a0ee5a8448cbc4a3f0d (diff)
Moved timer to separate file
Diffstat (limited to 'src/sys/timer.c')
-rw-r--r--src/sys/timer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/timer.c b/src/sys/timer.c
new file mode 100644
index 0000000..6996983
--- /dev/null
+++ b/src/sys/timer.c
@@ -0,0 +1,17 @@
+#include "../sys/core.h"
+#include "../sys/timer.h"
+#include "../util/time.h"
+#include "../drivers/uart.a.h"
+#include "../drivers/uart.h"
+
+void c_timer() {
+ // Reset the counter
+ write_cntv_tval(cntfrq);
+
+ // Output the value
+ uart_string((char*)"Timer Value: ");
+ unsigned long v = read_cntv_tval();
+ uart_10(v);
+ uart_char(0x20);
+ uart_hexn(v);
+}