Skip to content

Commit

Permalink
Merge pull request #14954 from benpicco/drivers/at86rf215-netif_pktq
Browse files Browse the repository at this point in the history
drivers/at86rf215: make use of packet queue if available
  • Loading branch information
benpicco authored Dec 1, 2020
2 parents c22bba5 + 7fc042e commit ef0eb90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions drivers/at86rf215/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 10 additions & 1 deletion drivers/at86rf215/at86rf215.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit ef0eb90

Please sign in to comment.