mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
Merge pull request #5289 from cgundogan/pr/at86rf2xx_netdev/fix
at86rf2xx_netdev: fix broken pending_tx handling
This commit is contained in:
commit
70a2d68a8a
@ -109,8 +109,8 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, int count)
|
||||
for (int i = 0; i < count; i++, ptr++) {
|
||||
/* current packet data + FCS too long */
|
||||
if ((len + ptr->iov_len + 2) > AT86RF2XX_MAX_PKT_LENGTH) {
|
||||
printf("[at86rf2xx] error: packet too large (%u byte) to be send\n",
|
||||
(unsigned)len + 2);
|
||||
DEBUG("[at86rf2xx] error: packet too large (%u byte) to be send\n",
|
||||
(unsigned)len + 2);
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
#ifdef MODULE_NETSTATS_L2
|
||||
@ -626,12 +626,10 @@ static void _isr(netdev2_t *netdev)
|
||||
state == AT86RF2XX_STATE_BUSY_TX_ARET) {
|
||||
/* check for more pending TX calls and return to idle state if
|
||||
* there are none */
|
||||
if (dev->pending_tx == 0) {
|
||||
assert(dev->pending_tx != 0);
|
||||
if ((--dev->pending_tx) == 0) {
|
||||
at86rf2xx_set_state(dev, dev->idle_state);
|
||||
}
|
||||
else {
|
||||
dev->pending_tx--;
|
||||
}
|
||||
|
||||
DEBUG("[at86rf2xx] EVT - TX_END\n");
|
||||
DEBUG("[at86rf2xx] return to state 0x%x\n", dev->idle_state);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user