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

tests/ieee802154_hal: spin if radio is BUSY on trx_state request

This commit is contained in:
Jose Alamos 2021-06-15 17:03:44 +02:00
parent 467236dba8
commit c464ab7e7c
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -423,7 +423,14 @@ int _cca(int argc, char **argv)
static inline void _set_trx_state(int state, bool verbose)
{
xtimer_ticks32_t a;
int res = ieee802154_radio_request_set_trx_state(&_radio[0], state);
int res;
/* Under certain conditions (internal house-keeping or sending ACK frames
* back) the radio could indicate it's busy. Therefore, busy loop until
* the radio doesn't report BUSY
*/
while((res = ieee802154_radio_request_set_trx_state(&_radio[0], state)) == -EBUSY) {}
if (verbose) {
a = xtimer_now();
if(res != 0) {