Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treewide: compile fixes for native #14663

Merged
merged 6 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/atwinc15x0/atwinc15x0_bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void nm_bsp_register_isr(tpfNmBspIsr pfIsr)
{
assert(atwinc15x0);

DEBUG("%s %p\n", __func__, pfIsr);
DEBUG("%s %p\n", __func__, (void *)(uintptr_t)pfIsr);

atwinc15x0->bsp_isr = pfIsr;
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/atwinc15x0/atwinc15x0_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static int _atwinc15x0_get(netdev_t *netdev, netopt_t opt, void *val,
assert(dev == atwinc15x0);

DEBUG("%s dev=%p opt=%u val=%p max_len=%u\n", __func__,
netdev, opt, val, max_len);
(void *)netdev, opt, val, max_len);

switch (opt) {
case NETOPT_IS_WIRED:
Expand Down Expand Up @@ -395,7 +395,7 @@ static int _atwinc15x0_set(netdev_t *netdev, netopt_t opt, const void *val,
assert(val);

DEBUG("%s dev=%p opt=%u val=%p max_len=%u\n", __func__,
netdev, opt, val, max_len);
(void *)netdev, opt, val, max_len);

switch (opt) {
case NETOPT_ADDRESS:
Expand All @@ -415,7 +415,7 @@ static int _atwinc15x0_init(netdev_t *netdev)
assert(dev);
assert(dev == atwinc15x0);

DEBUG("%s dev=%p\n", __func__, dev);
DEBUG("%s dev=%p\n", __func__, (void *)dev);

atwinc15x0->bsp_isr = NULL;
atwinc15x0->bsp_irq_enabled = true;
Expand Down Expand Up @@ -492,7 +492,7 @@ static void _atwinc15x0_isr(netdev_t *netdev)
assert(dev);
assert(dev == atwinc15x0);

DEBUG("%s dev=%p\n", __func__, dev);
DEBUG("%s dev=%p\n", __func__, (void *)dev);

/* handle pending ATWINC15x0 module events */
while (m2m_wifi_handle_events(NULL) != M2M_SUCCESS) { }
Expand Down
4 changes: 2 additions & 2 deletions drivers/cc110x/cc110x_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "cc110x.h"
#include "cc110x_internal.h"

const char cc110x_conf[CC110X_CONF_SIZE] = {
const uint8_t cc110x_conf[CC110X_CONF_SIZE] = {
/*
* IOCFG2; default: 0x29 (CHIP_RDYn)
* Invert GDO2: off,
Expand Down Expand Up @@ -327,4 +327,4 @@ const char cc110x_conf[CC110X_CONF_SIZE] = {
0x00, /*< RCCTRL0 */
};

const char cc110x_magic_registers[3] = { 0x88, 0x31, 0x09 };
const uint8_t cc110x_magic_registers[3] = { 0x88, 0x31, 0x09 };
4 changes: 2 additions & 2 deletions drivers/cc110x/include/cc110x_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern "C" {
/**
* @brief Configuration register values for CC1100/CC1101 transceivers
*/
extern const char cc110x_conf[CC110X_CONF_SIZE];
extern const uint8_t cc110x_conf[CC110X_CONF_SIZE];

/**
* @brief Magic numbers to write to the TEST2, TEST1 and TEST0 configuration
Expand All @@ -51,7 +51,7 @@ extern const char cc110x_conf[CC110X_CONF_SIZE];
* transceiver configuration, those numbers should be checked again with the
* SmartRF Studio
*/
extern const char cc110x_magic_registers[3];
extern const uint8_t cc110x_magic_registers[3];

/**
* @name Configuration data that specify the 8 available output power levels
Expand Down
6 changes: 3 additions & 3 deletions drivers/encx24j600/encx24j600.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define TX_BUFFER_END (RX_BUFFER_START)
#define TX_BUFFER_START (TX_BUFFER_END - TX_BUFFER_LEN)

static void cmd(encx24j600_t *dev, char cmd);
static void cmd(encx24j600_t *dev, uint8_t cmd);
static void reg_set(encx24j600_t *dev, uint8_t reg, uint16_t value);
static uint16_t reg_get(encx24j600_t *dev, uint8_t reg);
static void reg_clear_bits(encx24j600_t *dev, uint8_t reg, uint16_t mask);
Expand Down Expand Up @@ -163,8 +163,8 @@ static void phy_reg_set(encx24j600_t *dev, uint8_t reg, uint16_t value) {
reg_set(dev, ENC_MIWR, value);
}

static void cmd(encx24j600_t *dev, char cmd) {
spi_transfer_byte(dev->spi, dev->cs, false, (uint8_t)cmd);
static void cmd(encx24j600_t *dev, uint8_t cmd) {
spi_transfer_byte(dev->spi, dev->cs, false, cmd);
}

static void cmdn(encx24j600_t *dev, uint8_t cmd, char *out, char *in, int len) {
Expand Down
24 changes: 12 additions & 12 deletions drivers/include/cc110x.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ extern "C" {
* page 31 in the data sheet for the possible states in the status byte.
*/
typedef enum {
CC110X_STATE_IDLE = 0b00000000, /**< IDLE state */
CC110X_STATE_IDLE = 0x00, /**< IDLE state */
/**
* @brief Frame received, waiting for upper layer to retrieve it
*
* Transceiver is in IDLE state.
*/
CC110X_STATE_FRAME_READY = 0b00001000,
CC110X_STATE_FRAME_READY = 0x08,
/**
* @brief Frame received, waiting for upper layer to retrieve it
*
Expand All @@ -276,26 +276,26 @@ typedef enum {
* bring it in the IDLE state. Thus, we set the three least significant bits
* to the IDLE state
*/
CC110X_STATE_OFF = 0b00010000,
CC110X_STATE_RX_MODE = 0b00000001, /**< Listening for frames */
CC110X_STATE_OFF = 0x10,
CC110X_STATE_RX_MODE = 0x01, /**< Listening for frames */
/**
* @brief Receiving a frame just now
*
* Transceiver is in RX state.
*/
CC110X_STATE_RECEIVING = 0b00001001,
CC110X_STATE_TX_MODE = 0b00000010, /**< Transmit mode */
CC110X_STATE_RECEIVING = 0x09,
CC110X_STATE_TX_MODE = 0x02, /**< Transmit mode */
/**
* @brief Waiting for transceiver to complete outgoing transmission
*
* Transceiver is in TX state
*/
CC110X_STATE_TX_COMPLETING = 0b00001010,
CC110X_STATE_FSTXON = 0b00000011, /**< Fast TX ready */
CC110X_STATE_CALIBRATE = 0b00000100, /**< Device is calibrating */
CC110X_STATE_SETTLING = 0b00000101, /**< PLL is settling */
CC110X_STATE_RXFIFO_OVERFLOW = 0b00000110, /**< RX FIFO overflown */
CC110X_STATE_TXFIFO_UNDERFLOW = 0b00000111, /**< TX FIFO underflown */
CC110X_STATE_TX_COMPLETING = 0x0A,
CC110X_STATE_FSTXON = 0x03, /**< Fast TX ready */
CC110X_STATE_CALIBRATE = 0x04, /**< Device is calibrating */
CC110X_STATE_SETTLING = 0x05, /**< PLL is settling */
CC110X_STATE_RXFIFO_OVERFLOW = 0x06, /**< RX FIFO overflown */
CC110X_STATE_TXFIFO_UNDERFLOW = 0x07, /**< TX FIFO underflown */
} cc110x_state_t;

/**
Expand Down
4 changes: 2 additions & 2 deletions drivers/include/nrf24l01p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions drivers/kw2xrf/include/overwrites.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ extern "C" {
#endif

typedef struct overwrites_tag {
char address;
char data;
uint8_t address;
uint8_t data;
} overwrites_t;


Expand Down
10 changes: 5 additions & 5 deletions drivers/nrf24l01p/nrf24l01p.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/driver_atwinc15x0/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ CFLAGS += -Wno-incompatible-pointer-types-discards-qualifiers
CFLAGS += -DETH_MODE
CFLAGS += -I$(PKG_SOURCE_DIR)/src

CFLAGS += -Wno-pedantic

all:
"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/driver/source -f $(RIOTBASE)/Makefile.base MODULE=driver_atwinc15x0
"$(MAKE)" -C $(PKG_SOURCE_DIR)/src/common/source -f $(RIOTBASE)/Makefile.base MODULE=driver_atwinc15x0_common
Expand Down
2 changes: 1 addition & 1 deletion pkg/semtech-loramac/contrib/semtech_loramac.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void *_semtech_loramac_event_loop(void *arg)
case MSG_TYPE_MAC_TIMEOUT:
{
DEBUG("[semtech-loramac] MAC timer timeout\n");
void (*callback)(void) = msg.content.ptr;
void (*callback)(void) = (void (*)(void))(uintptr_t)msg.content.value;
callback();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/semtech-loramac/contrib/semtech_loramac_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void TimerStart(TimerEvent_t *obj)
xtimer_t *timer = &(obj->dev);
msg_t *msg = &(obj->msg);
msg->type = MSG_TYPE_MAC_TIMEOUT;
msg->content.ptr = obj->cb;
msg->content.value = (uintptr_t)obj->cb;
xtimer_set_msg(timer, obj->timeout, msg, semtech_loramac_pid);
}

Expand Down