1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cc2538_rf/radio_hal: fix transmit function

This commit sets the correct value to the MCU_CTRL bit for the
cc2538_rf. This variable is used to detect when the radio is doing
transmission with CCA. Since this was not set to 1 when sending without
CCA, the `confirm_transmit` function returned -EAGAIN after the TX_DONE
event (which violates the HAL API).

This error was discovered using some Radio HAL riotctrl scripts by @LarsKowoll.
This commit is contained in:
Jose Alamos 2021-01-08 11:38:02 +01:00
parent 2bf10413d0
commit 3c56cdf0c0
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -93,6 +93,13 @@ static int _request_transmit(ieee802154_dev_t *dev)
if (cc2538_csma_ca_retries < 0) {
RFCORE_SFR_RFST = ISTXON;
/* The CPU Ctrl mask is used here to indicate whether the radio is being
* controlled by the CPU or the CSP Strobe Processor.
* We set this to 1 in order to indicate that the CSP is not used and
* thus, that the @ref ieee802154_radio_ops::confirm_transmit should
* return 0 immediately after the TXDONE event
*/
RFCORE_XREG_CSPCTRL |= CC2538_CSP_MCU_CTRL_MASK;
}
else {
cc2538_cca = false;