added embedded_get_time_ms(void)

This commit is contained in:
matthias.ringwald@gmail.com 2014-11-16 21:19:23 +00:00
parent 5bb5bc3ed8
commit 8304b81b86
2 changed files with 7 additions and 0 deletions

View File

@ -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);
// Queries the current time in ms
uint32_t embedded_get_time_ms(void);
// Allows to update BTstack system ticks based on another already existing clock
void embedded_set_ticks(uint32_t ticks);
#endif

View File

@ -204,6 +204,11 @@ 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
/**