From 709148a4252c6d608808d9ed1380b02e94173d1b Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 4 Dec 2021 17:28:16 -0700 Subject: Moved timer to separate file --- src/sys/timer.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/sys/timer.c (limited to 'src/sys/timer.c') 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); +} -- cgit v1.2.1