diff --git a/platforms/posix/src/run_loop_posix.c b/platforms/posix/src/run_loop_posix.c index e5018706e..30e04b163 100644 --- a/platforms/posix/src/run_loop_posix.c +++ b/platforms/posix/src/run_loop_posix.c @@ -256,7 +256,7 @@ static void posix_init(void){ /** * @brief Queries the current time in ms since start */ -uint32_t posix_get_time_ms(void){ +static uint32_t posix_get_time_ms(void){ struct timeval current_tv; gettimeofday(¤t_tv, NULL); return (current_tv.tv_sec - init_tv.tv_sec) * 1000 diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index 66cc9f0ca..d456d2b66 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -225,17 +225,18 @@ void embedded_set_ticks(uint32_t ticks){ uint32_t embedded_ticks_for_ms(uint32_t time_in_ms){ return time_in_ms / hal_tick_get_tick_period_in_ms(); } - -uint32_t embedded_get_time_ms(void){ - return system_ticks * hal_tick_get_tick_period_in_ms(); -} #endif +static uint32_t embedded_get_time_ms(void){ #ifdef HAVE_TIME_MS -uint32_t embedded_get_time_ms(void){ return hal_time_ms(); -} #endif +#ifdef HAVE_TICK + return system_ticks * hal_tick_get_tick_period_in_ms(); +#endif + return 0; +} + /** * trigger run loop iteration