void consistentWait(int ms) { //Use animations for timing, because we enabled consistentTiming //This function will qWait for >= ms worth of consistent timing to elapse QPauseAnimation waitTimer(ms); waitTimer.start(); while (waitTimer.state() == QAbstractAnimation::Running) QTest::qWait(20); }
/*---------------------------------------------------------------------*/ PROCESS_THREAD(send_process, ev, data) { PROCESS_BEGIN(); static struct etimer timer; static uint16_t counter = 0; while (1) { PRINTF("Sending %i\n", counter); radioSend(&counter, sizeof(counter)); ++counter; redLedToggle(); waitTimer(timer, TIMER_INTERRUPT_HZ); } PROCESS_END(); }