1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

drivers/at86rf215: use non-blocking send if gnrc_netif_pktq is active

This commit is contained in:
Benjamin Valentin 2020-09-04 18:54:26 +02:00 committed by Benjamin Valentin
parent 60b5a6b35e
commit 7fc042e2a9
2 changed files with 16 additions and 1 deletions

View File

@ -19,6 +19,12 @@ FEATURES_REQUIRED += periph_gpio
FEATURES_REQUIRED += periph_gpio_irq
FEATURES_REQUIRED += periph_spi
ifneq (,$(filter gnrc,$(USEMODULE)))
ifeq (,$(filter gnrc_netif_pktq,$(USEMODULE)))
USEMODULE += at86rf215_blocking_send
endif
endif
USEMODULE += xtimer
USEMODULE += netif
USEMODULE += ieee802154

View File

@ -254,6 +254,10 @@ static void _block_while_busy(at86rf215_t *dev)
static void at86rf215_block_while_busy(at86rf215_t *dev)
{
if (!IS_ACTIVE(MODULE_AT86RF215_BLOCKING_SEND)) {
return;
}
if (_tx_ongoing(dev)) {
DEBUG("[at86rf215] Block while TXing\n");
_block_while_busy(dev);
@ -266,7 +270,12 @@ int at86rf215_tx_prepare(at86rf215_t *dev)
return -EAGAIN;
}
at86rf215_block_while_busy(dev);
if (!IS_ACTIVE(MODULE_AT86RF215_BLOCKING_SEND) && _tx_ongoing(dev)) {
return -EBUSY;
} else {
at86rf215_block_while_busy(dev);
}
dev->tx_frame_len = IEEE802154_FCS_LEN;
return 0;