From aa0e5e7afa2bdd3bddb4f24261d9b93d071346a5 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 22 Jul 2020 00:14:35 +0200 Subject: [PATCH] drivers/cc110x: replace binary constants and use unsigned char binary constants are a GCC extension --- drivers/cc110x/cc110x_settings.c | 4 ++-- drivers/cc110x/include/cc110x_settings.h | 4 ++-- drivers/include/cc110x.h | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/cc110x/cc110x_settings.c b/drivers/cc110x/cc110x_settings.c index 47241bba75ca..8009c1e47605 100644 --- a/drivers/cc110x/cc110x_settings.c +++ b/drivers/cc110x/cc110x_settings.c @@ -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, @@ -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 }; diff --git a/drivers/cc110x/include/cc110x_settings.h b/drivers/cc110x/include/cc110x_settings.h index 5522ab109347..704d25db6a24 100644 --- a/drivers/cc110x/include/cc110x_settings.h +++ b/drivers/cc110x/include/cc110x_settings.h @@ -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 @@ -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 diff --git a/drivers/include/cc110x.h b/drivers/include/cc110x.h index 4c3856d91d0b..532d6407a247 100644 --- a/drivers/include/cc110x.h +++ b/drivers/include/cc110x.h @@ -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 * @@ -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; /**