1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

boards/z1: fix cc2420_txrx function in CC2420 driver HAL

When waiting for transmission (to CC2420) to be done,
we were wrongly waiting for UCBUSY bit to be set,
while one should actually wait for that bit to be cleared.
This commit is contained in:
Kévin Roussel 2014-07-08 17:28:16 +02:00
parent a13066a0a6
commit 28c6481266

View File

@ -168,7 +168,7 @@ uint8_t cc2420_txrx(uint8_t data)
if (count >= MAX_SPI_WAIT) {
core_panic(0x2420, "cc2420_txrx(): couldn't send byte!");
}
} while(!(UCB0STAT & UCBUSY));
} while (UCB0STAT & UCBUSY);
/* Read the byte that CC2420 has (normally, during TX) returned */
count = 0;
do {
@ -176,7 +176,7 @@ uint8_t cc2420_txrx(uint8_t data)
if (count >= MAX_SPI_WAIT) {
core_panic(0x2420, "cc2420_txrx(): couldn't receive byte!");
}
} while(!(IFG2 & UCB0RXIFG));
} while (!(IFG2 & UCB0RXIFG));
/* Return received byte */
return UCB0RXBUF;
}