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

Merge pull request #7938 from bergzand/mrf24j40-bcast2

drivers/mrf24j40: fix radio ack request enabling
This commit is contained in:
Peter Kietzmann 2017-11-22 08:15:27 +01:00 committed by GitHub
commit 2c46e0928e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -137,6 +137,7 @@ typedef struct {
uint8_t idle_state; /**< state to return to after sending */
uint8_t tx_frame_len; /**< length of the current TX frame */
uint8_t header_len; /**< length of the header */
uint8_t fcf_low; /**< Low 8 FCF bits of the current TX frame. */
uint8_t pending; /**< Flags for pending tasks */
uint8_t irq_flag; /**< Flags for IRQs */
uint8_t tx_retries; /**< Number of retries needed for last transmission */

View File

@ -156,7 +156,7 @@ void mrf24j40_tx_exec(mrf24j40_t *dev)
*/
mrf24j40_reg_write_long(dev, MRF24J40_TX_NORMAL_FIFO, dev->header_len);
if (dev->netdev.flags & NETDEV_IEEE802154_ACK_REQ) {
if (dev->fcf_low & IEEE802154_FCF_ACK_REQ) {
mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNACKREQ | MRF24J40_TXNCON_TXNTRIG);
}
else {

View File

@ -106,6 +106,8 @@ static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
len = mrf24j40_tx_load(dev, ptr->iov_base, ptr->iov_len, len);
if (i == 0) {
dev->header_len = len;
/* Grab the FCF bits from the frame header */
dev->fcf_low = *(uint8_t*)(ptr->iov_base);
}
}