Fix code style: platform/zoul

This commit is contained in:
George Oikonomou 2015-11-24 12:09:23 +00:00 committed by Antonio Lignan
parent a30154c43e
commit 8727fef05b
11 changed files with 50 additions and 53 deletions

View File

@ -74,7 +74,7 @@ typedef uint32_t uip_stats_t;
* RTIMER_CLOCK_LT to override this * RTIMER_CLOCK_LT to override this
*/ */
typedef uint32_t rtimer_clock_t; typedef uint32_t rtimer_clock_t;
#define RTIMER_CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0) #define RTIMER_CLOCK_LT(a, b) ((int32_t)((a) - (b)) < 0)
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**
@ -83,7 +83,7 @@ typedef uint32_t rtimer_clock_t;
* @{ * @{
*/ */
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */ #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
#endif #endif
#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
@ -110,7 +110,7 @@ typedef uint32_t rtimer_clock_t;
* @{ * @{
*/ */
#ifndef WATCHDOG_CONF_ENABLE #ifndef WATCHDOG_CONF_ENABLE
#define WATCHDOG_CONF_ENABLE 1 /**< Enable the watchdog timer */ #define WATCHDOG_CONF_ENABLE 1 /**< Enable the watchdog timer */
#endif #endif
/** @} */ /** @} */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
@ -225,7 +225,7 @@ typedef uint32_t rtimer_clock_t;
* This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
* keep using SLIP * keep using SLIP
*/ */
#if defined (UIP_FALLBACK_INTERFACE) || defined (CMD_CONF_OUTPUT) #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
#define SLIP_ARCH_CONF_ENABLED 1 #define SLIP_ARCH_CONF_ENABLED 1
#endif #endif
#endif #endif
@ -369,10 +369,10 @@ typedef uint32_t rtimer_clock_t;
*/ */
#if REMOTE_DUAL_RF_ENABLED #if REMOTE_DUAL_RF_ENABLED
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ
#else /* REMOTE_DUAL_RF_ENABLED */ #else /* REMOTE_DUAL_RF_ENABLED */
#ifndef ANTENNA_SW_SELECT_DEF_CONF #ifndef ANTENNA_SW_SELECT_DEF_CONF
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ
#else /* ANTENNA_SW_SELECT_DEF_CONF */ #else /* ANTENNA_SW_SELECT_DEF_CONF */
#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF
#endif /* ANTENNA_SW_SELECT_DEF_CONF */ #endif /* ANTENNA_SW_SELECT_DEF_CONF */
#endif /* REMOTE_DUAL_RF_ENABLED */ #endif /* REMOTE_DUAL_RF_ENABLED */

View File

@ -114,9 +114,9 @@ configure(int type, int value)
return ZOUL_SENSORS_ERROR; return ZOUL_SENSORS_ERROR;
} }
if((value != ZOUL_SENSORS_ADC1) && (value != ZOUL_SENSORS_ADC2) && if((value != ZOUL_SENSORS_ADC1) && (value != ZOUL_SENSORS_ADC2) &&
(value != ZOUL_SENSORS_ADC3) && (value != ZOUL_SENSORS_ADC12) && (value != ZOUL_SENSORS_ADC3) && (value != ZOUL_SENSORS_ADC12) &&
(value != ZOUL_SENSORS_ADC13) && (value != ZOUL_SENSORS_ADC23)) { (value != ZOUL_SENSORS_ADC13) && (value != ZOUL_SENSORS_ADC23)) {
return ZOUL_SENSORS_ERROR; return ZOUL_SENSORS_ERROR;
} }

View File

@ -99,7 +99,7 @@ cc1200_arch_spi_select(void)
/* The MISO pin should go low before chip is fully enabled. */ /* The MISO pin should go low before chip is fully enabled. */
BUSYWAIT_UNTIL( BUSYWAIT_UNTIL(
GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK) == 0, GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK) == 0,
RTIMER_SECOND/100); RTIMER_SECOND / 100);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void
@ -129,7 +129,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
if((inbuf == NULL && write_buf == NULL) || len <= 0) { if((inbuf == NULL && write_buf == NULL) || len <= 0) {
return 1; return 1;
} else if(inbuf == NULL) { } else if(inbuf == NULL) {
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
SPI_WAITFORTx_BEFORE(); SPI_WAITFORTx_BEFORE();
@ -140,7 +139,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
/* read and discard to avoid "variable set but not used" warning */ /* read and discard to avoid "variable set but not used" warning */
(void)c; (void)c;
} }
} else if(write_buf == NULL) { } else if(write_buf == NULL) {
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
SPI_WAITFORTx_BEFORE(); SPI_WAITFORTx_BEFORE();
@ -149,7 +147,6 @@ cc1200_arch_spi_rw(uint8_t *inbuf, const uint8_t *write_buf, uint16_t len)
SPIX_WAITFOREORx(CC1200_SPI_INSTANCE); SPIX_WAITFOREORx(CC1200_SPI_INSTANCE);
inbuf[i] = SPIX_BUF(CC1200_SPI_INSTANCE); inbuf[i] = SPIX_BUF(CC1200_SPI_INSTANCE);
} }
} else { } else {
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
SPI_WAITFORTx_BEFORE(); SPI_WAITFORTx_BEFORE();
@ -171,7 +168,7 @@ cc1200_arch_gpio0_setup_irq(int rising)
GPIO_DETECT_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK); GPIO_DETECT_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK); GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
if (rising){ if(rising) {
GPIO_DETECT_RISING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK); GPIO_DETECT_RISING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
} else { } else {
GPIO_DETECT_FALLING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK); GPIO_DETECT_FALLING(CC1200_GDO0_PORT_BASE, CC1200_GDO0_PIN_MASK);
@ -193,7 +190,7 @@ cc1200_arch_gpio2_setup_irq(int rising)
GPIO_DETECT_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK); GPIO_DETECT_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK); GPIO_TRIGGER_SINGLE_EDGE(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
if (rising){ if(rising) {
GPIO_DETECT_RISING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK); GPIO_DETECT_RISING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
} else { } else {
GPIO_DETECT_FALLING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK); GPIO_DETECT_FALLING(CC1200_GDO2_PORT_BASE, CC1200_GDO2_PIN_MASK);
@ -279,7 +276,7 @@ cc1200_arch_init(void)
/* Ensure MISO is high */ /* Ensure MISO is high */
BUSYWAIT_UNTIL( BUSYWAIT_UNTIL(
GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK), GPIO_READ_PIN(CC1200_SPI_MISO_PORT_BASE, CC1200_SPI_MISO_PIN_MASK),
RTIMER_SECOND/10); RTIMER_SECOND / 10);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/** /**

View File

@ -113,7 +113,7 @@ sht25_read(uint8_t variable, uint16_t *rd)
return SHT25_ERROR; return SHT25_ERROR;
} }
if (sht25_read_reg(variable, buf, 2) == SHT25_SUCCESS){ if(sht25_read_reg(variable, buf, 2) == SHT25_SUCCESS) {
raw = (buf[0] << 8) + buf[1]; raw = (buf[0] << 8) + buf[1];
*rd = sht25_convert(variable, raw); *rd = sht25_convert(variable, raw);
return SHT25_SUCCESS; return SHT25_SUCCESS;
@ -125,7 +125,7 @@ static int
value(int type) value(int type)
{ {
uint16_t val; uint16_t val;
if (sht25_read(type, &val) == SHT25_SUCCESS){ if(sht25_read(type, &val) == SHT25_SUCCESS) {
return val; return val;
} }
return SHT25_ERROR; return SHT25_ERROR;

View File

@ -44,7 +44,7 @@
static void static void
configure_unused_pins(void) configure_unused_pins(void)
{ {
// FIXME /* FIXME */
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void

View File

@ -45,7 +45,7 @@
static void static void
configure_unused_pins(void) configure_unused_pins(void)
{ {
// FIXME /* FIXME */
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void