diff --git a/drivers/include/nrf24l01p.h b/drivers/include/nrf24l01p.h index de7ffb47fe..3dfb2294bf 100644 --- a/drivers/include/nrf24l01p.h +++ b/drivers/include/nrf24l01p.h @@ -340,7 +340,7 @@ int nrf24l01p_set_payload_width(const nrf24l01p_t *dev, * @return Address length on success. * @return -1 on error. */ -int nrf24l01p_set_tx_address(const nrf24l01p_t *dev, const char *saddr, unsigned int length); +int nrf24l01p_set_tx_address(const nrf24l01p_t *dev, const uint8_t *saddr, unsigned int length); /** * @brief Set the TX address for the nrf24l01+ transceiver (long int). @@ -370,7 +370,7 @@ int nrf24l01p_set_tx_address_long(const nrf24l01p_t *dev, uint64_t saddr, unsign * @return Address length on success. * @return -1 on error. */ -int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const char *saddr, unsigned int length); +int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const uint8_t *saddr, unsigned int length); /** * @brief Set the RX address for the nrf24l01+ transceiver (long int). diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c index 515e2b7db2..27c13085db 100644 --- a/drivers/nrf24l01p/nrf24l01p.c +++ b/drivers/nrf24l01p/nrf24l01p.c @@ -65,8 +65,8 @@ int nrf24l01p_write_reg(const nrf24l01p_t *dev, char reg, char write) int nrf24l01p_init(nrf24l01p_t *dev, spi_t spi, gpio_t ce, gpio_t cs, gpio_t irq) { int status; - static const char INITIAL_TX_ADDRESS[] = {0xe7, 0xe7, 0xe7, 0xe7, 0xe7,}; - static const char INITIAL_RX_ADDRESS[] = {0xe7, 0xe7, 0xe7, 0xe7, 0xe7,}; + static const uint8_t INITIAL_TX_ADDRESS[] = {0xe7, 0xe7, 0xe7, 0xe7, 0xe7,}; + static const uint8_t INITIAL_RX_ADDRESS[] = {0xe7, 0xe7, 0xe7, 0xe7, 0xe7,}; dev->spi = spi; dev->ce = ce; @@ -363,7 +363,7 @@ int nrf24l01p_set_payload_width(const nrf24l01p_t *dev, -int nrf24l01p_set_tx_address(const nrf24l01p_t *dev, const char *saddr, unsigned int length) +int nrf24l01p_set_tx_address(const nrf24l01p_t *dev, const uint8_t *saddr, unsigned int length) { /* Acquire exclusive access to the bus. */ spi_acquire(dev->spi, dev->cs, SPI_MODE, SPI_CLK); @@ -427,7 +427,7 @@ uint64_t nrf24l01p_get_tx_address_long(const nrf24l01p_t *dev) } -int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const char *saddr, unsigned int length) +int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, const uint8_t *saddr, unsigned int length) { char pipe_addr; @@ -477,7 +477,7 @@ int nrf24l01p_set_rx_address(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, c int nrf24l01p_set_rx_address_long(const nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe, uint64_t saddr, unsigned int length) { - char buf[length]; + uint8_t buf[length]; if (length <= INITIAL_ADDRESS_WIDTH) { for (unsigned int i = 0; i < length; i++) {