Bug fix
TelosB mote is on for 1ms too long because radio_rxEnable() is called
in activity_ri2 rather than activity_ri3.
@@ -236,25 +236,23 @@ void radio_rxEnable(void) {
// change state
radio_vars.state = RADIOSTATE_ENABLING_RX;
- // put radio in reception mode
- cc2420_spiStrobe(CC2420_SRXON, &radio_vars.radioStatusByte);
- cc2420_spiStrobe(CC2420_SFLUSHRX, &radio_vars.radioStatusByte);
-
// wiggle debug pin
debugpins_radio_set();
leds_radio_on();
-
- // busy wait until radio really listening
- while (radio_vars.radioStatusByte.rssi_valid==0) {
- cc2420_spiStrobe(CC2420_SNOP, &radio_vars.radioStatusByte);
}
+void radio_rxNow(void) {
// change state
radio_vars.state = RADIOSTATE_LISTENING;
-}
-void radio_rxNow(void) {
- // nothing to do, the radio is already listening.
+ // put radio in reception mode
+ cc2420_spiStrobe(CC2420_SRXON, &radio_vars.radioStatusByte);
+ cc2420_spiStrobe(CC2420_SFLUSHRX, &radio_vars.radioStatusByte);
+
+ // busy wait until radio really listening
+ while (radio_vars.radioStatusByte.rssi_valid==0) {
+ cc2420_spiStrobe(CC2420_SNOP, &radio_vars.radioStatusByte);
+ }
}
void radio_getReceivedFrame(
