From 8e2e534c60f1eb6c5c30be717b71589ecb173370 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 3 Oct 2014 11:41:26 +0200 Subject: [PATCH] Uncrustify/clean commented code --- flight/modules/GPS/GPS.c | 2 +- flight/modules/gpsp/gps9gpshandler.c | 5 ++--- flight/modules/gpsp/gps9maghandler.c | 2 +- flight/pios/stm32f0x/pios_usart.c | 10 ++++------ .../boards/gpsplatinum/firmware/inc/pios_config.h | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/flight/modules/GPS/GPS.c b/flight/modules/GPS/GPS.c index da4406f53..97151f2fb 100644 --- a/flight/modules/GPS/GPS.c +++ b/flight/modules/GPS/GPS.c @@ -90,7 +90,7 @@ void updateGpsSettings(UAVObjEvent *ev); #define STACK_SIZE_BYTES 1024 #else #if defined(PIOS_GPS_MINIMAL) - #define GPS_READ_BUFFER 32 + #define GPS_READ_BUFFER 32 #define STACK_SIZE_BYTES 500 #else #define STACK_SIZE_BYTES 650 diff --git a/flight/modules/gpsp/gps9gpshandler.c b/flight/modules/gpsp/gps9gpshandler.c index 337ee8a80..13f64ede2 100644 --- a/flight/modules/gpsp/gps9gpshandler.c +++ b/flight/modules/gpsp/gps9gpshandler.c @@ -45,7 +45,6 @@ void handleGPS() int32_t datacounter = PIOS_UBX_DDC_GetAvailableBytes(PIOS_I2C_GPS); if (datacounter > 0) { uint8_t toRead = (uint32_t)datacounter > BUFFER_SIZE - lastUnsentData ? BUFFER_SIZE - lastUnsentData : (uint8_t)datacounter; - //uint8_t toRead = (uint32_t)datacounter > BUFFER_SIZE ? BUFFER_SIZE : (uint8_t)datacounter; uint8_t toSend = toRead; PIOS_UBX_DDC_ReadData(PIOS_I2C_GPS, buffer, toRead); @@ -71,7 +70,7 @@ void handleGPS() if (datacounter > 0) { PIOS_UBX_DDC_WriteData(PIOS_I2C_GPS, buffer, datacounter); } - if(maxCount){ + if (maxCount) { // Note: this delay is needed as querying too quickly the UBX module's I2C(DDC) // port causes a lot of weird issues (it stops sending nav sentences) vTaskDelay(2 * configTICK_RATE_HZ / 1000); @@ -94,7 +93,7 @@ void setupGPS() cfgprt.fragments.data.txReady = CFG_PRT_DATA_TXREADI_DISABLED; cfgprt.fragments.data.mode = CFG_PRT_DATA_MODE_ADDR; cfgprt.fragments.data.reserved3 = 0; - cfgprt.fragments.data.inProtoMask = CFG_PRT_DATA_PROTO_UBX | CFG_PRT_DATA_PROTO_NMEA |CFG_PRT_DATA_PROTO_RTCM; + cfgprt.fragments.data.inProtoMask = CFG_PRT_DATA_PROTO_UBX | CFG_PRT_DATA_PROTO_NMEA | CFG_PRT_DATA_PROTO_RTCM; cfgprt.fragments.data.outProtoMask = CFG_PRT_DATA_PROTO_UBX; cfgprt.fragments.data.flags = 0; cfgprt.fragments.data.reserved5 = 0; diff --git a/flight/modules/gpsp/gps9maghandler.c b/flight/modules/gpsp/gps9maghandler.c index 0d49f3295..5ef2e06d8 100644 --- a/flight/modules/gpsp/gps9maghandler.c +++ b/flight/modules/gpsp/gps9maghandler.c @@ -40,7 +40,7 @@ void handleMag() } #else static uint32_t lastUpdate = 0; - if(PIOS_DELAY_DiffuS(lastUpdate) < (1000000 / MAG_RATE_HZ)){ + if (PIOS_DELAY_DiffuS(lastUpdate) < (1000000 / MAG_RATE_HZ)) { return; } lastUpdate = PIOS_DELAY_GetRaw(); diff --git a/flight/pios/stm32f0x/pios_usart.c b/flight/pios/stm32f0x/pios_usart.c index 867799be4..4239f31d5 100644 --- a/flight/pios/stm32f0x/pios_usart.c +++ b/flight/pios/stm32f0x/pios_usart.c @@ -65,9 +65,9 @@ struct pios_usart_dev { uint32_t rx_dropped; - uint8_t tx_buffer[PIOS_UART_TX_BUFFER]; - uint8_t tx_len; - uint8_t tx_pos; + uint8_t tx_buffer[PIOS_UART_TX_BUFFER]; + uint8_t tx_len; + uint8_t tx_pos; }; static struct pios_usart_dev *PIOS_USART_validate(uint32_t usart_id) @@ -288,9 +288,7 @@ static void PIOS_USART_generic_irq_handler(uint32_t usart_id) bool tx_need_yield = false; if (USART_GetITStatus(usart_dev->cfg->regs, USART_IT_TXE) != RESET) { if (usart_dev->tx_out_cb) { - //uint8_t b; - //uint16_t bytes_to_send; - if(!usart_dev->tx_len){ + if (!usart_dev->tx_len) { usart_dev->tx_len = (usart_dev->tx_out_cb)(usart_dev->tx_out_context, usart_dev->tx_buffer, PIOS_UART_TX_BUFFER, NULL, &tx_need_yield); usart_dev->tx_pos = 0; } diff --git a/flight/targets/boards/gpsplatinum/firmware/inc/pios_config.h b/flight/targets/boards/gpsplatinum/firmware/inc/pios_config.h index b618482af..5a36646cf 100644 --- a/flight/targets/boards/gpsplatinum/firmware/inc/pios_config.h +++ b/flight/targets/boards/gpsplatinum/firmware/inc/pios_config.h @@ -83,7 +83,7 @@ // #define PIOS_MPU6000_ACCEL /* #define PIOS_INCLUDE_HMC5843 */ #define PIOS_INCLUDE_HMC5X83 -//#define PIOS_HMC5X83_HAS_GPIOS +// #define PIOS_HMC5X83_HAS_GPIOS /* #define PIOS_INCLUDE_BMP085 */ /* #define PIOS_INCLUDE_MS5611 */ /* #define PIOS_INCLUDE_MPXV */