/** \brief The program starts executing here. */ int mote_main(void) { board_init(); leds_error_on(); debugpins_frame_set(); some_delay(); debugpins_frame_toggle(); some_delay(); debugpins_frame_toggle(); some_delay(); debugpins_frame_clr(); some_delay(); debugpins_slot_set(); some_delay(); debugpins_slot_toggle(); some_delay(); debugpins_slot_toggle(); some_delay(); debugpins_slot_clr(); some_delay(); debugpins_fsm_set(); some_delay(); debugpins_fsm_toggle(); some_delay(); debugpins_fsm_toggle(); some_delay(); debugpins_fsm_clr(); some_delay(); debugpins_task_set(); some_delay(); debugpins_task_toggle(); some_delay(); debugpins_task_toggle(); some_delay(); debugpins_task_clr(); some_delay(); debugpins_isr_set(); some_delay(); debugpins_isr_toggle(); some_delay(); debugpins_isr_toggle(); some_delay(); debugpins_isr_clr(); some_delay(); debugpins_radio_set(); some_delay(); debugpins_radio_toggle(); some_delay(); debugpins_radio_toggle(); some_delay(); debugpins_radio_clr(); some_delay(); board_reset(); return 0; }
void radiotimer_cb_overflow(void) { // toggle pin debugpins_slot_toggle(); // switch radio LED on leds_radio_toggle(); // increment counter app_dbg.radiotimer_num_overflow++; // wait a bit small_delay(); }
/** \brief The program starts executing here. */ int mote_main(void) { uint16_t delay; board_init(); while (1) { for (delay=0xffff;delay>0;delay--); debugpins_frame_toggle(); debugpins_slot_toggle(); debugpins_fsm_toggle(); debugpins_task_toggle(); debugpins_isr_toggle(); debugpins_radio_toggle(); } }
void cb_compare(void) { // toggle pin debugpins_slot_toggle(); // toggle radio LED leds_radio_toggle(); // schedule a next compare, if applicable app_vars.last_compare_val += RADIOTIMER_COMPARE_PERIOD; app_vars.num_compares_left--; if (app_vars.num_compares_left>0) { radiotimer_schedule(app_vars.last_compare_val); } else { radiotimer_cancel(); } // increment debug counter app_dbg.num_compare++; }
void radiotimer_cb_overflow(void) { volatile uint16_t delay; // toggle pin debugpins_slot_toggle(); // switch radio LED on leds_error_toggle(); // reset the counter for number of remaining compares app_vars.radiotimer_num_compares_left = RADIOTIMER_NUM_COMPARES; app_vars.radiotimer_last_compare_val = RADIOTIMER_COMPARE_PERIOD; radiotimer_schedule(app_vars.radiotimer_last_compare_val); // increment debug counter app_dbg.radiotimer_num_overflow++; // wait a bit for (delay=0;delay<ISR_DELAY;delay++); }