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:
parent
467236dba8
commit
c464ab7e7c
@ -423,7 +423,14 @@ int _cca(int argc, char **argv)
|
|||||||
static inline void _set_trx_state(int state, bool verbose)
|
static inline void _set_trx_state(int state, bool verbose)
|
||||||
{
|
{
|
||||||
xtimer_ticks32_t a;
|
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) {
|
if (verbose) {
|
||||||
a = xtimer_now();
|
a = xtimer_now();
|
||||||
if(res != 0) {
|
if(res != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user