summaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2019-02-25 16:42:25 -0700
committerKeith Packard <keithp@keithp.com>2019-02-25 16:42:25 -0700
commitcd920a0e5321166ef8b1d6afc3d63fc5de998a93 (patch)
tree91ac01e9748a5d9395b2d30fc0ed117584c9e95c /src/kernel
parent0448b9b638f8599633227a639ef9d8572780bbd9 (diff)
altos: add ao_time_ns API
This provides nano-second resolution times by reading the systick value (which runs at 250ns ticks on stm). Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/ao.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/ao.h b/src/kernel/ao.h
index c00de1fe..dddcd9cb 100644
--- a/src/kernel/ao.h
+++ b/src/kernel/ao.h
@@ -117,6 +117,10 @@ extern volatile AO_TICK_TYPE ao_tick_count;
AO_TICK_TYPE
ao_time(void);
+/* Returns the current time in ns */
+uint64_t
+ao_time_ns(void);
+
/* Suspend the current task until ticks time has passed */
void
ao_delay(uint16_t ticks);