diff --git a/include/btstack/run_loop.h b/include/btstack/run_loop.h index 06387eca2..3a94476f0 100644 --- a/include/btstack/run_loop.h +++ b/include/btstack/run_loop.h @@ -108,6 +108,8 @@ void run_loop_execute(void); uint32_t embedded_ticks_for_ms(uint32_t time_in_ms); // Queries the current time in ticks. uint32_t embedded_get_ticks(void); +// Allows to update BTstack system ticks based on another already existing clock +void embedded_set_ticks(uint32_t ticks); #endif #ifdef EMBEDDED // Sets an internal flag that is checked in the critical section @@ -115,8 +117,6 @@ uint32_t embedded_get_ticks(void); // handler of a data source to signal the run loop that a new data // is available. void embedded_trigger(void); -// execute run loop once for run_loop_embedded. pols all data sources and handles timers -void embedded_execute_once(void); #endif #if defined __cplusplus } diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index ca628c203..b9c8e325d 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -194,6 +194,10 @@ uint32_t embedded_get_ticks(void){ return system_ticks; } +void embedded_set_ticks(uint32_t ticks){ + system_ticks = ticks; +} + uint32_t embedded_ticks_for_ms(uint32_t time_in_ms){ return time_in_ms / hal_tick_get_tick_period_in_ms(); }