1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 14:03:55 +01:00

Merge pull request #14954 from benpicco/drivers/at86rf215-netif_pktq

drivers/at86rf215: make use of packet queue if available
This commit is contained in:
benpicco 2020-12-01 17:59:06 +01:00 committed by GitHub
commit ef0eb9044b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -24,6 +24,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 += ieee802154
USEMODULE += netdev_ieee802154

View File

@ -260,6 +260,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);
@ -272,7 +276,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;