aboutsummaryrefslogtreecommitdiff
path: root/sim/erc32/examples/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/erc32/examples/clock.c')
-rw-r--r--sim/erc32/examples/clock.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sim/erc32/examples/clock.c b/sim/erc32/examples/clock.c
new file mode 100644
index 0000000..ec23037
--- /dev/null
+++ b/sim/erc32/examples/clock.c
@@ -0,0 +1,8 @@
+
+int clock()
+{
+ volatile int *t_addr;
+
+ t_addr = (volatile int * ) 0x01F80080; /* Real-time clock address */
+ return(*t_addr);
+}