mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/nrf24l01p: fix vars lengths
This commit is contained in:
parent
e017033601
commit
1927104298
@ -36,11 +36,11 @@ extern "C" {
|
||||
* @brief Structure that represents the hardware setup of the nrf24l01+ transceiver.
|
||||
*/
|
||||
typedef struct {
|
||||
spi_t spi; /**< SPI device to initialize */
|
||||
gpio_t ce; /**< GPIO pin to initialize as chip enable */
|
||||
gpio_t cs; /**< GPIO pin to initialize as chip select */
|
||||
gpio_t irq; /**< GPIO pin to initialize as interrupt request */
|
||||
int listener; /**< Place to store an ID in */
|
||||
spi_t spi; /**< SPI device to initialize */
|
||||
gpio_t ce; /**< GPIO pin to initialize as chip enable */
|
||||
gpio_t cs; /**< GPIO pin to initialize as chip select */
|
||||
gpio_t irq; /**< GPIO pin to initialize as interrupt request */
|
||||
unsigned listener; /**< Place to store an ID in */
|
||||
} nrf24l01p_t;
|
||||
|
||||
/**
|
||||
|
@ -386,7 +386,7 @@ int nrf24l01p_set_tx_address_long(const nrf24l01p_t *dev, uint64_t saddr, unsign
|
||||
char buf[length];
|
||||
|
||||
if (length <= INITIAL_ADDRESS_WIDTH) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
|
||||
buf[i] = (uint8_t)(saddr >> (((length - 1) - i) * sizeof(uint64_t)));
|
||||
}
|
||||
@ -483,7 +483,7 @@ int nrf24l01p_set_rx_address_long(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pi
|
||||
char buf[length];
|
||||
|
||||
if (length <= INITIAL_ADDRESS_WIDTH) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
for (unsigned int i = 0; i < length; i++) {
|
||||
|
||||
buf[i] = (uint8_t)(saddr >> (((length - 1) - i) * 8));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user