[nrf528xx] add radio and random platform fixes (#3634)

* [nrf52811] add radio and random platform fixes

* [nrf528xx] handle all radio driver rx/tx errors
This commit is contained in:
Piotr Szkotak
2019-02-27 12:41:41 -08:00
committed by Jonathan Hui
parent f9884b8afc
commit 096632a475
3 changed files with 14 additions and 1 deletions
+5
View File
@@ -722,6 +722,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
switch (error)
{
case NRF_802154_RX_ERROR_INVALID_FRAME:
case NRF_802154_RX_ERROR_DELAYED_TIMEOUT:
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
break;
@@ -736,6 +737,8 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
case NRF_802154_RX_ERROR_RUNTIME:
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
case NRF_802154_RX_ERROR_ABORTED:
case NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED:
case NRF_802154_RX_ERROR_INVALID_LENGTH:
sReceiveError = OT_ERROR_FAILED;
break;
@@ -774,6 +777,8 @@ void nrf_802154_transmit_failed(const uint8_t *aFrame, nrf_802154_tx_error_t err
{
case NRF_802154_TX_ERROR_BUSY_CHANNEL:
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
case NRF_802154_TX_ERROR_ABORTED:
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
setPendingEvent(kPendingEventChannelAccessFailure);
break;
+5 -1
View File
@@ -162,7 +162,11 @@ void nrf5RandomInit(void)
void nrf5RandomDeinit(void)
{
// Intentionally empty.
generatorStop();
NVIC_DisableIRQ(RNG_IRQn);
NVIC_ClearPendingIRQ(RNG_IRQn);
NVIC_SetPriority(RNG_IRQn, 0);
}
uint32_t otPlatRandomGet(void)
+4
View File
@@ -723,6 +723,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
switch (error)
{
case NRF_802154_RX_ERROR_INVALID_FRAME:
case NRF_802154_RX_ERROR_DELAYED_TIMEOUT:
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
break;
@@ -737,6 +738,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
case NRF_802154_RX_ERROR_RUNTIME:
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
case NRF_802154_RX_ERROR_ABORTED:
case NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED:
case NRF_802154_RX_ERROR_INVALID_LENGTH:
sReceiveError = OT_ERROR_FAILED;
break;
@@ -776,6 +778,8 @@ void nrf_802154_transmit_failed(const uint8_t *aFrame, nrf_802154_tx_error_t err
{
case NRF_802154_TX_ERROR_BUSY_CHANNEL:
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
case NRF_802154_TX_ERROR_ABORTED:
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
setPendingEvent(kPendingEventChannelAccessFailure);
break;