diff options
author | Christian Cunningham <cc@localhost> | 2021-12-04 17:28:16 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2021-12-04 17:28:16 -0700 |
commit | 709148a4252c6d608808d9ed1380b02e94173d1b (patch) | |
tree | 5da3abd1020476cf3964cc10691546ce059108a4 /src/sys/timer.c | |
parent | 1c6cd8e1ea53275cc44b2a0ee5a8448cbc4a3f0d (diff) |
Moved timer to separate file
Diffstat (limited to 'src/sys/timer.c')
-rw-r--r-- | src/sys/timer.c | 17 |
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); +} |