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

tests/ieee802154_hal: use blocking CCA when no IRQ is present

This commit is contained in:
Jose Alamos 2022-08-17 14:46:23 +02:00
parent 42a2f6b43c
commit 4d81677afd
No known key found for this signature in database
GPG Key ID: F483EB800EF89DD9

View File

@ -376,12 +376,20 @@ int _cca(int argc, char **argv)
{
(void) argc;
(void) argv;
if (ieee802154_radio_request_cca(&_radio[0]) < 0) {
puts("Couldn't perform CCA");
int res;
if (ieee802154_radio_has_irq_cca_done(&_radio[0])) {
if (ieee802154_radio_request_cca(&_radio[0]) < 0) {
puts("Couldn't perform CCA");
return -ENODEV;
}
mutex_lock(&lock);
res = ieee802154_radio_confirm_cca(&_radio[0]);
expect(res >= 0);
}
else {
res = ieee802154_radio_cca(&_radio[0]);
}
mutex_lock(&lock);
int res = ieee802154_radio_confirm_cca(&_radio[0]);
expect(res >= 0);
if (res > 0) {
puts("CLEAR");