aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorLorenz Meier <lorenz@px4.io>2015-03-28 11:20:55 -0700
committerLorenz Meier <lorenz@px4.io>2015-03-28 11:20:55 -0700
commitb24af0f402ed5512d078c7afc0aa92e7ce1c166b (patch)
tree893833e818d8138360f8fa0bf5554dc6b036f369 /src/drivers
parent898bf51047c0331798e6446025de6cdd8f0ae878 (diff)
parent8aae66b893444c74a22ad7beb89e3828e0444108 (diff)
downloadpx4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.tar.gz
px4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.tar.bz2
px4-firmware-b24af0f402ed5512d078c7afc0aa92e7ce1c166b.zip
Merge pull request #1960 from dagar/format
Trivial code style cleanup round 2
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/airspeed/airspeed.h6
-rw-r--r--src/drivers/ardrone_interface/ardrone_motor_control.h3
-rw-r--r--src/drivers/boards/aerocore/aerocore_spi.c4
-rw-r--r--src/drivers/boards/px4fmu-v1/px4fmu_spi.c4
-rw-r--r--src/drivers/boards/px4io-v2/board_config.h4
-rw-r--r--src/drivers/device/i2c.h6
-rw-r--r--src/drivers/drv_hrt.h3
-rw-r--r--src/drivers/drv_rgbled.h4
-rw-r--r--src/drivers/frsky_telemetry/frsky_data.c3
-rw-r--r--src/drivers/md25/BlockSysIdent.hpp3
10 files changed, 22 insertions, 18 deletions
diff --git a/src/drivers/airspeed/airspeed.h b/src/drivers/airspeed/airspeed.h
index d6a88714b..cdaf244dd 100644
--- a/src/drivers/airspeed/airspeed.h
+++ b/src/drivers/airspeed/airspeed.h
@@ -90,7 +90,7 @@ static const int ERROR = -1;
class __EXPORT Airspeed : public device::I2C
{
public:
- Airspeed(int bus, int address, unsigned conversion_interval, const char* path);
+ Airspeed(int bus, int address, unsigned conversion_interval, const char *path);
virtual ~Airspeed();
virtual int init();
@@ -108,8 +108,8 @@ private:
perf_counter_t _buffer_overflows;
/* this class has pointer data members and should not be copied */
- Airspeed(const Airspeed&);
- Airspeed& operator=(const Airspeed&);
+ Airspeed(const Airspeed &);
+ Airspeed &operator=(const Airspeed &);
protected:
virtual int probe();
diff --git a/src/drivers/ardrone_interface/ardrone_motor_control.h b/src/drivers/ardrone_interface/ardrone_motor_control.h
index 78b603b63..dcc49a472 100644
--- a/src/drivers/ardrone_interface/ardrone_motor_control.h
+++ b/src/drivers/ardrone_interface/ardrone_motor_control.h
@@ -85,7 +85,8 @@ int ar_init_motors(int ardrone_uart, int gpio);
/**
* Set LED pattern.
*/
-void ar_set_leds(int ardrone_uart, uint8_t led1_red, uint8_t led1_green, uint8_t led2_red, uint8_t led2_green, uint8_t led3_red, uint8_t led3_green, uint8_t led4_red, uint8_t led4_green);
+void ar_set_leds(int ardrone_uart, uint8_t led1_red, uint8_t led1_green, uint8_t led2_red, uint8_t led2_green,
+ uint8_t led3_red, uint8_t led3_green, uint8_t led4_red, uint8_t led4_green);
/**
* Mix motors and output actuators
diff --git a/src/drivers/boards/aerocore/aerocore_spi.c b/src/drivers/boards/aerocore/aerocore_spi.c
index e329bd9d1..0fa474a8c 100644
--- a/src/drivers/boards/aerocore/aerocore_spi.c
+++ b/src/drivers/boards/aerocore/aerocore_spi.c
@@ -136,8 +136,8 @@ __EXPORT void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid,
switch (devid) {
case PX4_SPIDEV_GYRO:
- /* Making sure the other peripherals are not selected */
- stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
+ /* Making sure the other peripherals are not selected */
+ stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
stm32_gpiowrite(GPIO_SPI_CS_ACCEL_MAG, 1);
stm32_gpiowrite(GPIO_SPI_CS_BARO, 1);
break;
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c
index 17e6862f7..16f94a9f2 100644
--- a/src/drivers/boards/px4fmu-v1/px4fmu_spi.c
+++ b/src/drivers/boards/px4fmu-v1/px4fmu_spi.c
@@ -90,8 +90,8 @@ __EXPORT void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid,
switch (devid) {
case PX4_SPIDEV_GYRO:
- /* Making sure the other peripherals are not selected */
- stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
+ /* Making sure the other peripherals are not selected */
+ stm32_gpiowrite(GPIO_SPI_CS_GYRO, !selected);
stm32_gpiowrite(GPIO_SPI_CS_MPU, 1);
stm32_gpiowrite(GPIO_SPI_CS_ACCEL, 1);
break;
diff --git a/src/drivers/boards/px4io-v2/board_config.h b/src/drivers/boards/px4io-v2/board_config.h
index 10a93be0b..99baee41d 100644
--- a/src/drivers/boards/px4io-v2/board_config.h
+++ b/src/drivers/boards/px4io-v2/board_config.h
@@ -50,7 +50,7 @@
/* these headers are not C++ safe */
#include <stm32.h>
#include <arch/board/board.h>
-
+
/******************************************************************************
* Definitions
******************************************************************************/
@@ -117,7 +117,7 @@
#define GPIO_SBUS_OUTPUT (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN10)
#define GPIO_SBUS_OENABLE (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
-/*
+/*
* High-resolution timer
*/
#define HRT_TIMER 1 /* use timer1 for the HRT */
diff --git a/src/drivers/device/i2c.h b/src/drivers/device/i2c.h
index 7bb4ae1af..cb13fed83 100644
--- a/src/drivers/device/i2c.h
+++ b/src/drivers/device/i2c.h
@@ -63,7 +63,7 @@ public:
static int set_bus_clock(unsigned bus, unsigned clock_hz);
static unsigned int _bus_clocks[3];
-
+
protected:
/**
* The number of times a read or write operation will be retried on
@@ -144,8 +144,8 @@ private:
uint32_t _frequency;
struct i2c_dev_s *_dev;
- I2C(const device::I2C&);
- I2C operator=(const device::I2C&);
+ I2C(const device::I2C &);
+ I2C operator=(const device::I2C &);
};
} // namespace device
diff --git a/src/drivers/drv_hrt.h b/src/drivers/drv_hrt.h
index 8bfc90c64..a40943d3f 100644
--- a/src/drivers/drv_hrt.h
+++ b/src/drivers/drv_hrt.h
@@ -127,7 +127,8 @@ __EXPORT extern void hrt_call_at(struct hrt_call *entry, hrt_abstime calltime, h
* Note thet the interval is timed between scheduled, not actual, call times, so the call rate may
* jitter but should not drift.
*/
-__EXPORT extern void hrt_call_every(struct hrt_call *entry, hrt_abstime delay, hrt_abstime interval, hrt_callout callout, void *arg);
+__EXPORT extern void hrt_call_every(struct hrt_call *entry, hrt_abstime delay, hrt_abstime interval,
+ hrt_callout callout, void *arg);
/*
* If this returns true, the entry has been invoked and removed from the callout list,
diff --git a/src/drivers/drv_rgbled.h b/src/drivers/drv_rgbled.h
index b10caf56a..063376868 100644
--- a/src/drivers/drv_rgbled.h
+++ b/src/drivers/drv_rgbled.h
@@ -58,7 +58,7 @@
/** play the numbered script in (arg), repeating forever */
#define RGBLED_PLAY_SCRIPT _RGBLEDIOC(2)
-/**
+/**
* Set the user script; (arg) is a pointer to an array of script lines,
* where each line is an array of four bytes giving <duration>, <command>, arg[0-2]
*
@@ -79,7 +79,7 @@
#define RGBLED_SET_PATTERN _RGBLEDIOC(7)
-/*
+/*
structure passed to RGBLED_SET_RGB ioctl()
Note that the driver scales the brightness to 0 to 255, regardless
of the hardware scaling
diff --git a/src/drivers/frsky_telemetry/frsky_data.c b/src/drivers/frsky_telemetry/frsky_data.c
index 890fada16..de22a888d 100644
--- a/src/drivers/frsky_telemetry/frsky_data.c
+++ b/src/drivers/frsky_telemetry/frsky_data.c
@@ -222,6 +222,7 @@ void frsky_send_frame2(int uart)
float course = 0, lat = 0, lon = 0, speed = 0, alt = 0;
char lat_ns = 0, lon_ew = 0;
int sec = 0;
+
if (global_pos.timestamp != 0 && hrt_absolute_time() < global_pos.timestamp + 20000) {
time_t time_gps = global_pos.time_utc_usec / 1000000ULL;
struct tm *tm_gps = gmtime(&time_gps);
@@ -232,7 +233,7 @@ void frsky_send_frame2(int uart)
lon = frsky_format_gps(fabsf(global_pos.lon));
lon_ew = (global_pos.lon < 0) ? 'W' : 'E';
speed = sqrtf(global_pos.vel_n * global_pos.vel_n + global_pos.vel_e * global_pos.vel_e)
- * 25.0f / 46.0f;
+ * 25.0f / 46.0f;
alt = global_pos.alt;
sec = tm_gps->tm_sec;
}
diff --git a/src/drivers/md25/BlockSysIdent.hpp b/src/drivers/md25/BlockSysIdent.hpp
index 270635f40..e8dd4ee9c 100644
--- a/src/drivers/md25/BlockSysIdent.hpp
+++ b/src/drivers/md25/BlockSysIdent.hpp
@@ -1,7 +1,8 @@
#include <controllib/block/Block.hpp>
#include <controllib/block/BlockParam.hpp>
-class BlockSysIdent : public control::Block {
+class BlockSysIdent : public control::Block
+{
public:
BlockSysIdent();
private: