Skip to content

Commit 2ee05de

Browse files
committed
EFR32 radio driver small fixes
* Reduce verbosity of EFR32 radio driver when debug tracing is on. * Correctly pass pending bit of received ACK to the stack.
1 parent d710ec4 commit 2ee05de

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

features/nanostack/FEATURE_NANOSTACK/targets/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
288288
data_length + 3
289289
};
290290

291-
tr_debug("Called TX, len %d, chan %d\n", data_length, channel);
292-
293291
switch(radio_state) {
294292
case RADIO_UNINIT:
295293
tr_debug("Radio uninit\n");
@@ -329,6 +327,8 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
329327
txOpt.waitForAck = false;
330328
}
331329

330+
//tr_debug("Called TX, len %d, chan %d, ack %d\n", data_length, channel, waiting_for_ack ? 1 : 0);
331+
332332
if(RAIL_TxStartWithOptions(channel, &txOpt, &RAIL_CcaCsma, (RAIL_CsmaConfig_t*) &csma_config) == 0) {
333333
//Save packet number and sequence
334334
current_tx_handle = tx_handle;
@@ -614,7 +614,6 @@ void RAILCb_RfReady(void) {
614614
* @param[in] status A bit field that defines what event caused the callback
615615
*/
616616
void RAILCb_TxRadioStatus(uint8_t status) {
617-
tr_debug("Packet TX error %d\n", status);
618617
if(device_driver.phy_tx_done_cb != NULL) {
619618
if(status == RAIL_TX_CONFIG_BUFFER_UNDERFLOW ||
620619
status == RAIL_TX_CONFIG_CHANNEL_BUSY ||
@@ -626,6 +625,8 @@ void RAILCb_TxRadioStatus(uint8_t status) {
626625
PHY_LINK_CCA_FAIL,
627626
8,
628627
1);
628+
} else {
629+
tr_debug("Packet TX error %d\n", status);
629630
}
630631
}
631632
radio_state = RADIO_RX;
@@ -645,7 +646,13 @@ void RAILCb_TxRadioStatus(uint8_t status) {
645646
* @param[in] status The event that triggered this callback
646647
*/
647648
void RAILCb_RxRadioStatus(uint8_t status) {
648-
tr_debug("RXE %d\n", status);
649+
switch(status) {
650+
case RAIL_RX_CONFIG_ADDRESS_FILTERED:
651+
break;
652+
default:
653+
tr_debug("RXE %d\n", status);
654+
break;
655+
}
649656
}
650657

651658
/**
@@ -729,7 +736,7 @@ void RAILCb_RxPacketReceived(void *rxPacketHandle) {
729736
//tr_debug("rACK\n");
730737
device_driver.phy_tx_done_cb( rf_radio_driver_id,
731738
current_tx_handle,
732-
PHY_LINK_TX_DONE,
739+
last_ack_pending_bit ? PHY_LINK_TX_DONE_PENDING : PHY_LINK_TX_DONE,
733740
1,
734741
1);
735742
} else {
@@ -787,6 +794,7 @@ void RAILCb_IEEE802154_DataRequestCommand(RAIL_IEEE802154_Address_t *address) {
787794
*/
788795
void RAILCb_RxAckTimeout(void) {
789796
if(waiting_for_ack) {
797+
tr_debug("nACK\n");
790798
waiting_for_ack = false;
791799
device_driver.phy_tx_done_cb( rf_radio_driver_id,
792800
current_tx_handle,

0 commit comments

Comments
 (0)