Skip to content

Commit 7b7e2c9

Browse files
e-rkrlubos
authored andcommitted
openthread: platform: Remove API migration code
The nrf-802154 driver now returns an error code instead of bool. The migration code can be removed. Signed-off-by: Rafał Kuźnia <[email protected]>
1 parent 6f26006 commit 7b7e2c9

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

modules/openthread/platform/radio_nrf5.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,10 @@ static bool nrf5_tx(const otRadioFrame *frame, uint8_t *payload, bool cca)
680680
},
681681
};
682682

683-
#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE
684683
nrf_802154_tx_error_t result = nrf_802154_transmit_raw(payload, &metadata);
684+
__ASSERT(result != NRF_802154_TX_ERROR_INVALID_REQUEST, "Invalid transmit request");
685685

686686
return result == NRF_802154_TX_ERROR_NONE;
687-
#else
688-
return nrf_802154_transmit_raw(payload, &metadata);
689-
#endif
690687
}
691688

692689
#if NRF_802154_CSMA_CA_ENABLED
@@ -709,13 +706,10 @@ static bool nrf5_tx_csma_ca(otRadioFrame *frame, uint8_t *payload)
709706

710707
nrf_802154_csma_ca_max_backoffs_set(frame->mInfo.mTxInfo.mMaxCsmaBackoffs);
711708

712-
#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE
713709
nrf_802154_tx_error_t result = nrf_802154_transmit_csma_ca_raw(payload, &metadata);
710+
__ASSERT(result != NRF_802154_TX_ERROR_INVALID_REQUEST, "Invalid transmit request");
714711

715712
return result == NRF_802154_TX_ERROR_NONE;
716-
#else
717-
return nrf_802154_transmit_csma_ca_raw(payload, &metadata);
718-
#endif
719713
}
720714
#endif
721715

@@ -751,13 +745,10 @@ static bool nrf5_tx_at(otRadioFrame *frame, uint8_t *payload)
751745
nrf5_data.tx.frame.mInfo.mTxInfo.mTxDelay) /
752746
NSEC_PER_USEC);
753747

754-
#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE
755748
nrf_802154_tx_error_t result = nrf_802154_transmit_raw_at(payload, tx_at, &metadata);
749+
__ASSERT(result != NRF_802154_TX_ERROR_INVALID_REQUEST, "Invalid transmit request");
756750

757751
return result == NRF_802154_TX_ERROR_NONE;
758-
#else
759-
return nrf_802154_transmit_raw_at(payload, tx_at, &metadata);
760-
#endif
761752
}
762753

763754
static void handle_frame_received(otInstance *aInstance)

0 commit comments

Comments
 (0)