[kernel][timer] Fixup dynamic timer
Modify platform.h to add definitions of hooks required by implementation of dynamic timer Disable setting periodic timer if PLATFORM_HAS_DYNAMIC_TIMER is chosen. Fix a warning.
This commit is contained in:
@@ -29,5 +29,10 @@ typedef enum handler_return (*platform_timer_callback)(void *arg, lk_time_t now)
|
||||
|
||||
status_t platform_set_periodic_timer(platform_timer_callback callback, void *arg, lk_time_t interval);
|
||||
|
||||
#if PLATFORM_HAS_DYNAMIC_TIMER
|
||||
status_t platform_set_oneshot_timer (platform_timer_callback callback, void *arg, lk_time_t interval);
|
||||
void platform_stop_timer(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ void timer_cancel(timer_t *timer)
|
||||
else
|
||||
delay = newhead->scheduled_time - now;
|
||||
|
||||
LTRACEF("setting new timer to %d\n", delay);
|
||||
LTRACEF("setting new timer to %u\n", (uint) delay);
|
||||
platform_set_oneshot_timer(timer_tick, NULL, delay);
|
||||
}
|
||||
#endif
|
||||
@@ -270,8 +270,10 @@ void timer_init(void)
|
||||
{
|
||||
list_initialize(&timer_queue);
|
||||
|
||||
#if !PLATFORM_HAS_DYNAMIC_TIMER
|
||||
/* register for a periodic timer tick */
|
||||
platform_set_periodic_timer(timer_tick, NULL, 10); /* 10ms */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user