From cd920a0e5321166ef8b1d6afc3d63fc5de998a93 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 25 Feb 2019 16:42:25 -0700 Subject: 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 --- src/kernel/ao.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kernel') 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); -- cgit v1.2.3