void vtimer_callback(void *ptr) { DEBUG("vtimer_callback ptr=%p\n", ptr); (void) ptr; in_callback = true; hwtimer_id = -1; /* get the vtimer that fired */ vtimer_t *timer = node_get_timer(priority_queue_remove_head(&shortterm_priority_queue_root)); if (timer) { #if ENABLE_DEBUG vtimer_print(timer); #endif DEBUG("vtimer_callback(): Shooting %" PRIu32 ".\n", timer->absolute.microseconds); /* shoot timer */ timer->action(timer); } else { DEBUG("vtimer_callback(): spurious call.\n"); } in_callback = false; update_shortterm(); }
void vtimer_callback(void *ptr) { vtimer_t *timer; in_callback = true; hwtimer_id = -1; timer = (vtimer_t *)queue_remove_head(&shortterm_queue_root); #ifdef ENABLE_DEBUG vtimer_print(timer); #endif DEBUG("vtimer_callback(): Shooting %lu.\n", timer->absolute.microseconds); /* shoot timer */ if (timer->action == (void*) msg_send_int) { msg_t msg; msg.type = MSG_TIMER; msg.content.value = (unsigned int) timer->arg; msg_send_int(&msg, timer->pid); } else { timer->action(timer->arg); } in_callback = false; update_shortterm(); }