diff --git a/include/btstack/run_loop.h b/include/btstack/run_loop.h index 31d9ad4d0..2c7b36d64 100644 --- a/include/btstack/run_loop.h +++ b/include/btstack/run_loop.h @@ -76,7 +76,7 @@ typedef struct timer { // set timer based on current time -void run_loop_set_timer(timer_source_t *a, int timeout_in_ms); +void run_loop_set_timer(timer_source_t *a, uint32_t timeout_in_ms); // add/remove timer_source void run_loop_add_timer(timer_source_t *timer); diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index f5009a224..473403b58 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -146,8 +146,8 @@ static void embedded_tick_handler(void){ } // set timer -void run_loop_set_timer(timer_source_t *ts, int timeout_in_ms){ - int ticks = timeout_in_ms / hal_tick_get_tick_period_in_ms(); +void run_loop_set_timer(timer_source_t *ts, uint32_t timeout_in_ms){ + uint32_t ticks = timeout_in_ms / hal_tick_get_tick_period_in_ms(); if (ticks == 0) ticks++; ts->timeout = system_ticks + ticks; }