aboutsummaryrefslogtreecommitdiffstats
path: root/src/sam3x8e/timer.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-07-12 22:16:16 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-07-17 15:02:43 -0400
commit118fd21cb815d1c27e7e5bd6b394369bdf095919 (patch)
tree78ceda354491dfb66419f0a7e892017a05319a73 /src/sam3x8e/timer.c
parent969485c754731183f357e6fef23c6180f59d4cb6 (diff)
downloadkutter-118fd21cb815d1c27e7e5bd6b394369bdf095919.tar.gz
kutter-118fd21cb815d1c27e7e5bd6b394369bdf095919.tar.xz
kutter-118fd21cb815d1c27e7e5bd6b394369bdf095919.zip
irq: Support sleeping when mcu is idle
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/sam3x8e/timer.c')
-rw-r--r--src/sam3x8e/timer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sam3x8e/timer.c b/src/sam3x8e/timer.c
index 0bc21dae..ba1124cb 100644
--- a/src/sam3x8e/timer.c
+++ b/src/sam3x8e/timer.c
@@ -18,6 +18,13 @@ timer_set(uint32_t value)
TC0->TC_CHANNEL[0].TC_RA = value;
}
+// Return the next scheduled wake up time
+uint32_t
+timer_get_next(void)
+{
+ return TC0->TC_CHANNEL[0].TC_RA;
+}
+
// Return the current time (in absolute clock ticks).
uint32_t
timer_read_time(void)