mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/cc2420: fix logical error in cc2420_do_send function
Do the correct test in cc2420_do_send() function when analyzing the result of cc2420_load_tx_buf()
This commit is contained in:
parent
65e240f950
commit
a5a468a52b
@ -172,7 +172,7 @@ radio_tx_status_t cc2420_transmit_tx_buf(void)
|
||||
cc2420_switch_to_rx();
|
||||
|
||||
/* check for underflow error flag */
|
||||
if (st & 0x20) {
|
||||
if (st & CC2420_STATUS_TX_UNDERFLOW) {
|
||||
return RADIO_TX_UNDERFLOW;
|
||||
}
|
||||
|
||||
@ -203,12 +203,12 @@ radio_tx_status_t cc2420_do_send(ieee802154_packet_kind_t kind,
|
||||
void *buf,
|
||||
unsigned int len)
|
||||
{
|
||||
bool ok = cc2420_load_tx_buf(kind, dest,
|
||||
use_long_addr,
|
||||
wants_ack,
|
||||
buf, len);
|
||||
if (!ok) {
|
||||
return RADIO_TX_ERROR;
|
||||
radio_tx_status_t st = cc2420_load_tx_buf(kind, dest,
|
||||
use_long_addr,
|
||||
wants_ack,
|
||||
buf, len);
|
||||
if (st != RADIO_TX_OK) {
|
||||
return st;
|
||||
}
|
||||
return cc2420_transmit_tx_buf();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user