コード例 #1
0
ファイル: 01bsp_bothtimers.c プロジェクト: Babody/openwsn-fw
/**
\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();
   }
}
コード例 #2
0
ファイル: radio_obj.c プロジェクト: Babody/openwsn-fw
void radio_setOverflowCb(OpenMote* self, radiotimer_compare_cbt cb) {
   
#ifdef TRACE_ON
   printf("C@0x%x: radio_setOverflowCb(cb=0x%x)... \n",self,cb);
#endif
   
   radiotimer_setOverflowCb(self, cb);
   
#ifdef TRACE_ON
   printf("C@0x%x: ...done.\n",self);
#endif
}
コード例 #3
0
ファイル: 01bsp_closetimers.c プロジェクト: Adilla/openwsn-fw
/**
\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();
   }
}
コード例 #4
0
/**
\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();
   }
}
コード例 #5
0
ファイル: radio.c プロジェクト: giu7ppe/openwsn
void radio_setOverflowCb(radiotimer_compare_cbt cb) {
   radiotimer_setOverflowCb(cb);
}