tests/ieee802154_hal: use _set_trx_state where possible
This commit is contained in:
parent
c464ab7e7c
commit
fd81b978fc
@ -106,9 +106,10 @@ void _crc_error_handler(event_t *event)
|
|||||||
(void) event;
|
(void) event;
|
||||||
puts("Packet with invalid CRC received");
|
puts("Packet with invalid CRC received");
|
||||||
ieee802154_dev_t* dev = &_radio[0];
|
ieee802154_dev_t* dev = &_radio[0];
|
||||||
/* switch back to RX_ON state */
|
if (!ieee802154_radio_has_rx_continuous(dev)) {
|
||||||
ieee802154_radio_request_set_trx_state(dev, IEEE802154_TRX_STATE_RX_ON);
|
/* switch back to RX_ON state */
|
||||||
while (ieee802154_radio_confirm_set_trx_state(dev) == -EAGAIN) {}
|
_set_trx_state(IEEE802154_TRX_STATE_RX_ON, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static event_t _crc_error_event = {
|
static event_t _crc_error_event = {
|
||||||
@ -119,6 +120,7 @@ void _rx_done_handler(event_t *event)
|
|||||||
{
|
{
|
||||||
(void) event;
|
(void) event;
|
||||||
ieee802154_rx_info_t info;
|
ieee802154_rx_info_t info;
|
||||||
|
ieee802154_dev_t* dev = &_radio[0];
|
||||||
|
|
||||||
/* Read packet from internal framebuffer
|
/* Read packet from internal framebuffer
|
||||||
*
|
*
|
||||||
@ -131,9 +133,10 @@ void _rx_done_handler(event_t *event)
|
|||||||
_print_packet(size, info.lqi, info.rssi);
|
_print_packet(size, info.lqi, info.rssi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go out of the HAL's FB Lock state after frame reception and trigger a
|
if (!ieee802154_radio_has_rx_continuous(dev)) {
|
||||||
* state change */
|
/* switch back to RX_ON state */
|
||||||
_set_trx_state(IEEE802154_TRX_STATE_RX_ON, false);
|
_set_trx_state(IEEE802154_TRX_STATE_RX_ON, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static event_t _rx_done_event = {
|
static event_t _rx_done_event = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user