Demo PAH8011+HeartRate on nRF52
Dependencies: mbed pixart_heart_rate_demo pixart_heart_rate_lib_keil_m4
Diff: system_clock.cpp
- Revision:
- 0:a6408c845aba
diff -r 000000000000 -r a6408c845aba system_clock.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/system_clock.cpp Fri Oct 27 08:53:49 2017 +0000 @@ -0,0 +1,31 @@ +#include "system_clock.h" + +#include <mbed.h> + + +static Ticker g_ticker; +static volatile uint64_t g_sys_tick = 0; + + +static void system_tick_handle(void) +{ + g_sys_tick++; +} + +void system_clock_init() +{ + g_sys_tick = 0; + + g_ticker.attach(system_tick_handle, 0.001f); +} + +uint64_t system_clock_get_tick() +{ + return g_sys_tick; +} + +uint64_t system_clock_time_to_milliseconds(uint64_t time) +{ + return time; +} +