/** \brief The program starts executing here. */ int mote_main(void) { // initialize board board_init(); // switch radio LED on leds_radio_on(); // prepare bsp_timer bsp_timer_set_callback(bsp_timer_cb_compare); // prepare radiotimer radiotimer_setOverflowCb(radiotimer_cb_overflow); radiotimer_setCompareCb(radiotimer_cb_compare); // kick off first bsp_timer compare bsp_timer_scheduleIn(BSP_TIMER_PERIOD); // start periodic radiotimer overflow radiotimer_start(RADIOTIMER_OVERFLOW_PERIOD); // kick off first radiotimer compare app_vars.radiotimer_num_compares_left = RADIOTIMER_NUM_COMPARES-1; app_vars.radiotimer_last_compare_val = RADIOTIMER_COMPARE_PERIOD; radiotimer_schedule(app_vars.radiotimer_last_compare_val); while (1) { board_sleep(); } }
void radio_setCompareCb(OpenMote* self, radiotimer_compare_cbt cb) { #ifdef TRACE_ON printf("C@0x%x: radio_setCompareCb(cb=0x%x)... \n",self,cb); #endif radiotimer_setCompareCb(self, cb); #ifdef TRACE_ON printf("C@0x%x: ...done.\n",self); #endif }
/** \brief The program starts executing here. */ int mote_main(void) { // initialize board board_init(); // prepare bsp_timer bsp_timer_set_callback(bsp_timer_cb_compare); // prepare radiotimer radiotimer_setOverflowCb(radiotimer_cb_overflow); radiotimer_setCompareCb(radiotimer_cb_compare); // kick off first bsp_timer compare bsp_timer_scheduleIn(BSP_TIMER_PERIOD); // start periodic radiotimer overflow radiotimer_start(RADIOTIMER_OVERFLOW_PERIOD); while (1) { board_sleep(); } }
/** \brief The program starts executing here. */ int mote_main(void) { // initialize board board_init(); // prepare radiotimer radiotimer_setOverflowCb(cb_overflow); radiotimer_setCompareCb(cb_compare); // kick off first compare app_vars.num_compares_left = RADIOTIMER_NUM_COMPARES-1; app_vars.last_compare_val = RADIOTIMER_COMPARE_PERIOD; // start periodic overflow radiotimer_start(RADIOTIMER_OVERFLOW_PERIOD); leds_radio_on(); radiotimer_schedule(app_vars.last_compare_val); while (1) { board_sleep(); } }
void radio_setCompareCb(radiotimer_compare_cbt cb) { radiotimer_setCompareCb(cb); }