test: timer use k_busy_wait()

test/timer/timer_api use k_busy_wait to implement the
tests' busy_wait_ms, for archs which require a different
type of busy waiting

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
Alberto Escolar Piedras 2017-11-29 08:19:12 +01:00 committed by Anas Nashif
parent 8c9118c2ab
commit ccae2bbcd6

View File

@ -74,19 +74,7 @@ static void status_expire(struct k_timer *timer)
static void busy_wait_ms(s32_t ms)
{
#ifdef CONFIG_TICKLESS_KERNEL
k_enable_sys_clock_always_on();
#endif
s32_t deadline = k_uptime_get() + ms;
volatile s32_t now = k_uptime_get();
while (now < deadline) {
now = k_uptime_get();
}
#ifdef CONFIG_TICKLESS_KERNEL
k_disable_sys_clock_always_on();
#endif
k_busy_wait(ms*1000);
}
static void status_stop(struct k_timer *timer)