mirror of
https://github.com/espressif/openthread.git
synced 2026-10-05 23:37:38 +00:00
[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:
committed by
Jonathan Hui
parent
f9884b8afc
commit
096632a475
@@ -722,6 +722,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
|
|||||||
switch (error)
|
switch (error)
|
||||||
{
|
{
|
||||||
case NRF_802154_RX_ERROR_INVALID_FRAME:
|
case NRF_802154_RX_ERROR_INVALID_FRAME:
|
||||||
|
case NRF_802154_RX_ERROR_DELAYED_TIMEOUT:
|
||||||
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
|
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
|
||||||
break;
|
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_RUNTIME:
|
||||||
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
|
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
|
||||||
case NRF_802154_RX_ERROR_ABORTED:
|
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;
|
sReceiveError = OT_ERROR_FAILED;
|
||||||
break;
|
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_BUSY_CHANNEL:
|
||||||
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
|
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
|
||||||
|
case NRF_802154_TX_ERROR_ABORTED:
|
||||||
|
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
|
||||||
setPendingEvent(kPendingEventChannelAccessFailure);
|
setPendingEvent(kPendingEventChannelAccessFailure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,11 @@ void nrf5RandomInit(void)
|
|||||||
|
|
||||||
void nrf5RandomDeinit(void)
|
void nrf5RandomDeinit(void)
|
||||||
{
|
{
|
||||||
// Intentionally empty.
|
generatorStop();
|
||||||
|
|
||||||
|
NVIC_DisableIRQ(RNG_IRQn);
|
||||||
|
NVIC_ClearPendingIRQ(RNG_IRQn);
|
||||||
|
NVIC_SetPriority(RNG_IRQn, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t otPlatRandomGet(void)
|
uint32_t otPlatRandomGet(void)
|
||||||
|
|||||||
@@ -723,6 +723,7 @@ void nrf_802154_receive_failed(nrf_802154_rx_error_t error)
|
|||||||
switch (error)
|
switch (error)
|
||||||
{
|
{
|
||||||
case NRF_802154_RX_ERROR_INVALID_FRAME:
|
case NRF_802154_RX_ERROR_INVALID_FRAME:
|
||||||
|
case NRF_802154_RX_ERROR_DELAYED_TIMEOUT:
|
||||||
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
|
sReceiveError = OT_ERROR_NO_FRAME_RECEIVED;
|
||||||
break;
|
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_RUNTIME:
|
||||||
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
|
case NRF_802154_RX_ERROR_TIMESLOT_ENDED:
|
||||||
case NRF_802154_RX_ERROR_ABORTED:
|
case NRF_802154_RX_ERROR_ABORTED:
|
||||||
|
case NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED:
|
||||||
case NRF_802154_RX_ERROR_INVALID_LENGTH:
|
case NRF_802154_RX_ERROR_INVALID_LENGTH:
|
||||||
sReceiveError = OT_ERROR_FAILED;
|
sReceiveError = OT_ERROR_FAILED;
|
||||||
break;
|
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_BUSY_CHANNEL:
|
||||||
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
|
case NRF_802154_TX_ERROR_TIMESLOT_ENDED:
|
||||||
|
case NRF_802154_TX_ERROR_ABORTED:
|
||||||
|
case NRF_802154_TX_ERROR_TIMESLOT_DENIED:
|
||||||
setPendingEvent(kPendingEventChannelAccessFailure);
|
setPendingEvent(kPendingEventChannelAccessFailure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user