aboutsummaryrefslogtreecommitdiff
path: root/src/sys/timer.c
diff options
context:
space:
mode:
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);
+}