aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Agar <daniel@agar.ca>2015-03-02 14:36:04 -0500
committerLorenz Meier <lm@inf.ethz.ch>2015-03-19 23:49:36 +0100
commitc2abb0f82ac23aab3295522ade4c255323191931 (patch)
treea87146edb8736e8f447e97eb6624b909aefe57c2 /src
parentc147424fe735d92c5271ba3b5bc830bb33fb6097 (diff)
downloadpx4-firmware-c2abb0f82ac23aab3295522ade4c255323191931.tar.gz
px4-firmware-c2abb0f82ac23aab3295522ade4c255323191931.tar.bz2
px4-firmware-c2abb0f82ac23aab3295522ade4c255323191931.zip
fix code style if trivial one line difference
Diffstat (limited to 'src')
-rw-r--r--src/drivers/boards/aerocore/board_config.h2
-rw-r--r--src/drivers/boards/px4fmu-v1/board_config.h2
-rw-r--r--src/drivers/boards/px4fmu-v2/board_config.h2
-rw-r--r--src/drivers/boards/px4io-v1/px4io_init.c2
-rw-r--r--src/drivers/boards/px4io-v2/px4iov2_init.c2
-rw-r--r--src/drivers/drv_airspeed.h2
-rw-r--r--src/drivers/drv_blinkm.h2
-rw-r--r--src/drivers/drv_orb_dev.h2
-rw-r--r--src/drivers/drv_oreoled.h2
-rw-r--r--src/drivers/drv_pwm_input.h2
-rw-r--r--src/drivers/hmc5883/hmc5883.h2
-rw-r--r--src/drivers/ms5611/ms5611.h2
-rw-r--r--src/examples/fixedwing_control/params.c2
-rw-r--r--src/examples/fixedwing_control/params.h2
-rw-r--r--src/examples/flow_position_estimator/flow_position_estimator_params.c2
-rw-r--r--src/examples/flow_position_estimator/flow_position_estimator_params.h2
-rw-r--r--src/lib/conversion/rotation.h2
-rw-r--r--src/lib/launchdetection/LaunchDetector.h2
-rw-r--r--src/lib/rc/st24.h2
-rwxr-xr-xsrc/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c1
-rw-r--r--src/modules/commander/calibration_routines.h3
-rw-r--r--src/modules/fixedwing_backside/params.c2
-rw-r--r--src/modules/mavlink/mavlink_stream.cpp1
-rw-r--r--src/modules/navigator/geofence.h2
-rw-r--r--src/modules/position_estimator_inav/inertial_filter.c1
-rw-r--r--src/modules/px4iofirmware/sbus.c2
-rw-r--r--src/modules/sensors/sensor_params.c2
-rw-r--r--src/modules/systemlib/circuit_breaker.cpp2
-rw-r--r--src/modules/systemlib/circuit_breaker.h2
-rw-r--r--src/modules/systemlib/rc_check.h2
-rw-r--r--src/modules/uORB/topics/esc_status.h2
-rw-r--r--src/modules/uORB/topics/fence.h2
-rw-r--r--src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp1
-rw-r--r--src/systemcmds/tests/test_jig_voltages.c2
-rw-r--r--src/systemcmds/tests/test_rc.c2
-rw-r--r--src/systemcmds/tests/test_uart_send.c2
-rw-r--r--src/systemcmds/usb_connected/usb_connected.c2
37 files changed, 38 insertions, 33 deletions
diff --git a/src/drivers/boards/aerocore/board_config.h b/src/drivers/boards/aerocore/board_config.h
index 776a2071e..19518d73d 100644
--- a/src/drivers/boards/aerocore/board_config.h
+++ b/src/drivers/boards/aerocore/board_config.h
@@ -54,7 +54,7 @@ __BEGIN_DECLS
#include <arch/board/board.h>
#define UDID_START 0x1FFF7A10
-
+
/****************************************************************************************************
* Definitions
****************************************************************************************************/
diff --git a/src/drivers/boards/px4fmu-v1/board_config.h b/src/drivers/boards/px4fmu-v1/board_config.h
index 882ec6aa2..17fa9c542 100644
--- a/src/drivers/boards/px4fmu-v1/board_config.h
+++ b/src/drivers/boards/px4fmu-v1/board_config.h
@@ -52,7 +52,7 @@ __BEGIN_DECLS
/* these headers are not C++ safe */
#include <stm32.h>
#include <arch/board/board.h>
-
+
/****************************************************************************************************
* Definitions
****************************************************************************************************/
diff --git a/src/drivers/boards/px4fmu-v2/board_config.h b/src/drivers/boards/px4fmu-v2/board_config.h
index 273af1023..6188e29ae 100644
--- a/src/drivers/boards/px4fmu-v2/board_config.h
+++ b/src/drivers/boards/px4fmu-v2/board_config.h
@@ -54,7 +54,7 @@ __BEGIN_DECLS
#include <arch/board/board.h>
#define UDID_START 0x1FFF7A10
-
+
/****************************************************************************************************
* Definitions
****************************************************************************************************/
diff --git a/src/drivers/boards/px4io-v1/px4io_init.c b/src/drivers/boards/px4io-v1/px4io_init.c
index 8292da9e1..5a02a9716 100644
--- a/src/drivers/boards/px4io-v1/px4io_init.c
+++ b/src/drivers/boards/px4io-v1/px4io_init.c
@@ -87,7 +87,7 @@ __EXPORT void stm32_boardinitialize(void)
stm32_configgpio(GPIO_RELAY1_EN);
stm32_configgpio(GPIO_RELAY2_EN);
- /* turn off - all leds are active low */
+ /* turn off - all leds are active low */
stm32_gpiowrite(GPIO_LED1, true);
stm32_gpiowrite(GPIO_LED2, true);
stm32_gpiowrite(GPIO_LED3, true);
diff --git a/src/drivers/boards/px4io-v2/px4iov2_init.c b/src/drivers/boards/px4io-v2/px4iov2_init.c
index 5c3343ccc..fd7eb33c3 100644
--- a/src/drivers/boards/px4io-v2/px4iov2_init.c
+++ b/src/drivers/boards/px4io-v2/px4iov2_init.c
@@ -126,7 +126,7 @@ __EXPORT void stm32_boardinitialize(void)
stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */
stm32_configgpio(GPIO_SBUS_OUTPUT);
-
+
/* sbus output enable is active low - disable it by default */
stm32_gpiowrite(GPIO_SBUS_OENABLE, true);
stm32_configgpio(GPIO_SBUS_OENABLE);
diff --git a/src/drivers/drv_airspeed.h b/src/drivers/drv_airspeed.h
index 2ff91d5d0..fddef3626 100644
--- a/src/drivers/drv_airspeed.h
+++ b/src/drivers/drv_airspeed.h
@@ -35,7 +35,7 @@
* @file drv_airspeed.h
*
* Airspeed driver interface.
- *
+ *
* @author Simon Wilks
*/
diff --git a/src/drivers/drv_blinkm.h b/src/drivers/drv_blinkm.h
index 7258c9e84..8568436d3 100644
--- a/src/drivers/drv_blinkm.h
+++ b/src/drivers/drv_blinkm.h
@@ -60,7 +60,7 @@
/** play the numbered script in (arg), repeating forever */
#define BLINKM_PLAY_SCRIPT _BLINKMIOC(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]
*
diff --git a/src/drivers/drv_orb_dev.h b/src/drivers/drv_orb_dev.h
index e0b16fa5c..c1db6b534 100644
--- a/src/drivers/drv_orb_dev.h
+++ b/src/drivers/drv_orb_dev.h
@@ -36,7 +36,7 @@
/**
* @file drv_orb_dev.h
- *
+ *
* uORB published object driver.
*/
diff --git a/src/drivers/drv_oreoled.h b/src/drivers/drv_oreoled.h
index 0dcb10a7b..00e368318 100644
--- a/src/drivers/drv_oreoled.h
+++ b/src/drivers/drv_oreoled.h
@@ -117,7 +117,7 @@ enum oreoled_macro {
OREOLED_PARAM_MACRO_ENUM_COUNT
};
-/*
+/*
structure passed to OREOLED_SET_RGB ioctl()
Note that the driver scales the brightness to 0 to 255, regardless
of the hardware scaling
diff --git a/src/drivers/drv_pwm_input.h b/src/drivers/drv_pwm_input.h
index 778d9fcf5..47b84e6e1 100644
--- a/src/drivers/drv_pwm_input.h
+++ b/src/drivers/drv_pwm_input.h
@@ -46,6 +46,6 @@ __BEGIN_DECLS
/*
* Initialise the timer
*/
-__EXPORT extern int pwm_input_main(int argc, char * argv[]);
+__EXPORT extern int pwm_input_main(int argc, char *argv[]);
__END_DECLS
diff --git a/src/drivers/hmc5883/hmc5883.h b/src/drivers/hmc5883/hmc5883.h
index e91e91fc0..9607fe614 100644
--- a/src/drivers/hmc5883/hmc5883.h
+++ b/src/drivers/hmc5883/hmc5883.h
@@ -50,4 +50,4 @@
/* interface factories */
extern device::Device *HMC5883_SPI_interface(int bus) weak_function;
extern device::Device *HMC5883_I2C_interface(int bus) weak_function;
-typedef device::Device* (*HMC5883_constructor)(int);
+typedef device::Device *(*HMC5883_constructor)(int);
diff --git a/src/drivers/ms5611/ms5611.h b/src/drivers/ms5611/ms5611.h
index c8211b8dd..c946e38cb 100644
--- a/src/drivers/ms5611/ms5611.h
+++ b/src/drivers/ms5611/ms5611.h
@@ -82,4 +82,4 @@ extern bool crc4(uint16_t *n_prom);
/* interface factories */
extern device::Device *MS5611_spi_interface(ms5611::prom_u &prom_buf, uint8_t busnum) weak_function;
extern device::Device *MS5611_i2c_interface(ms5611::prom_u &prom_buf, uint8_t busnum) weak_function;
-typedef device::Device* (*MS5611_constructor)(ms5611::prom_u &prom_buf, uint8_t busnum);
+typedef device::Device *(*MS5611_constructor)(ms5611::prom_u &prom_buf, uint8_t busnum);
diff --git a/src/examples/fixedwing_control/params.c b/src/examples/fixedwing_control/params.c
index c2e94ff3d..fbbd30201 100644
--- a/src/examples/fixedwing_control/params.c
+++ b/src/examples/fixedwing_control/params.c
@@ -34,7 +34,7 @@
/*
* @file params.c
- *
+ *
* Parameters for fixedwing demo
*/
diff --git a/src/examples/fixedwing_control/params.h b/src/examples/fixedwing_control/params.h
index 4ae8e90ec..49ffff446 100644
--- a/src/examples/fixedwing_control/params.h
+++ b/src/examples/fixedwing_control/params.h
@@ -34,7 +34,7 @@
/*
* @file params.h
- *
+ *
* Definition of parameters for fixedwing example
*/
diff --git a/src/examples/flow_position_estimator/flow_position_estimator_params.c b/src/examples/flow_position_estimator/flow_position_estimator_params.c
index ec3c3352d..b56579787 100644
--- a/src/examples/flow_position_estimator/flow_position_estimator_params.c
+++ b/src/examples/flow_position_estimator/flow_position_estimator_params.c
@@ -35,7 +35,7 @@
/*
* @file flow_position_estimator_params.c
- *
+ *
* Parameters for position estimator
*/
diff --git a/src/examples/flow_position_estimator/flow_position_estimator_params.h b/src/examples/flow_position_estimator/flow_position_estimator_params.h
index f9a9bb303..3ab4e560f 100644
--- a/src/examples/flow_position_estimator/flow_position_estimator_params.h
+++ b/src/examples/flow_position_estimator/flow_position_estimator_params.h
@@ -35,7 +35,7 @@
/*
* @file flow_position_estimator_params.h
- *
+ *
* Parameters for position estimator
*/
diff --git a/src/lib/conversion/rotation.h b/src/lib/conversion/rotation.h
index 917c7f830..13fe701df 100644
--- a/src/lib/conversion/rotation.h
+++ b/src/lib/conversion/rotation.h
@@ -118,7 +118,7 @@ const rot_lookup_t rot_lookup[] = {
* Get the rotation matrix
*/
__EXPORT void
-get_rot_matrix(enum Rotation rot, math::Matrix<3,3> *rot_matrix);
+get_rot_matrix(enum Rotation rot, math::Matrix<3, 3> *rot_matrix);
/**
diff --git a/src/lib/launchdetection/LaunchDetector.h b/src/lib/launchdetection/LaunchDetector.h
index 4215b49d2..3b276c556 100644
--- a/src/lib/launchdetection/LaunchDetector.h
+++ b/src/lib/launchdetection/LaunchDetector.h
@@ -76,7 +76,7 @@ private:
method is checked for further adavancing in the state machine (e.g. when
to power up the motors) */
- LaunchMethod* launchMethods[1];
+ LaunchMethod *launchMethods[1];
control::BlockParamInt launchdetection_on;
control::BlockParamFloat throttlePreTakeoff;
diff --git a/src/lib/rc/st24.h b/src/lib/rc/st24.h
index 454234601..0cf732824 100644
--- a/src/lib/rc/st24.h
+++ b/src/lib/rc/st24.h
@@ -158,6 +158,6 @@ uint8_t st24_common_crc8(uint8_t *ptr, uint8_t len);
* @return 0 for success (a decoded packet), 1 for no packet yet (accumulating), 2 for unknown packet, 3 for out of sync, 4 for checksum error
*/
__EXPORT int st24_decode(uint8_t byte, uint8_t *rssi, uint8_t *rx_count, uint16_t *channel_count,
- uint16_t *channels, uint16_t max_chan_count);
+ uint16_t *channels, uint16_t max_chan_count);
__END_DECLS
diff --git a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
index 5637ec102..e143f37b9 100755
--- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
+++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c
@@ -177,6 +177,7 @@ int parameters_update(const struct attitude_estimator_ekf_param_handles *h, stru
for (int i = 0; i < 3; i++) {
param_get(h->moment_inertia_J[i], &(p->moment_inertia_J[3 * i + i]));
}
+
param_get(h->use_moment_inertia, &(p->use_moment_inertia));
return OK;
diff --git a/src/modules/commander/calibration_routines.h b/src/modules/commander/calibration_routines.h
index 3c8e49ee9..ba4ca07cc 100644
--- a/src/modules/commander/calibration_routines.h
+++ b/src/modules/commander/calibration_routines.h
@@ -57,4 +57,5 @@
* @return 0 on success, 1 on failure
*/
int sphere_fit_least_squares(const float x[], const float y[], const float z[],
- unsigned int size, unsigned int max_iterations, float delta, float *sphere_x, float *sphere_y, float *sphere_z, float *sphere_radius); \ No newline at end of file
+ unsigned int size, unsigned int max_iterations, float delta, float *sphere_x, float *sphere_y, float *sphere_z,
+ float *sphere_radius); \ No newline at end of file
diff --git a/src/modules/fixedwing_backside/params.c b/src/modules/fixedwing_backside/params.c
index db30af416..aa82a4f59 100644
--- a/src/modules/fixedwing_backside/params.c
+++ b/src/modules/fixedwing_backside/params.c
@@ -57,7 +57,7 @@ PARAM_DEFINE_FLOAT(FWB_V_CMD, 12.0f); // commanded velocity
PARAM_DEFINE_FLOAT(FWB_V_MAX, 16.0f); // maximum commanded velocity
// rate of climb
-// this is what rate of climb is commanded (in m/s)
+// this is what rate of climb is commanded (in m/s)
// when the pitch stick is fully defelcted in simple mode
PARAM_DEFINE_FLOAT(FWB_CR_MAX, 1.0f);
diff --git a/src/modules/mavlink/mavlink_stream.cpp b/src/modules/mavlink/mavlink_stream.cpp
index 5b9e45d3e..57a92c8b5 100644
--- a/src/modules/mavlink/mavlink_stream.cpp
+++ b/src/modules/mavlink/mavlink_stream.cpp
@@ -80,6 +80,7 @@ MavlinkStream::update(const hrt_abstime t)
if (dt > 0 && dt >= interval) {
/* interval expired, send message */
send(t);
+
if (const_rate()) {
_last_sent = (t / _interval) * _interval;
diff --git a/src/modules/navigator/geofence.h b/src/modules/navigator/geofence.h
index 9d647cb68..37a41b68a 100644
--- a/src/modules/navigator/geofence.h
+++ b/src/modules/navigator/geofence.h
@@ -76,7 +76,7 @@ public:
* @return true: system is inside fence, false: system is outside fence
*/
bool inside(const struct vehicle_global_position_s &global_position,
- const struct vehicle_gps_position_s &gps_position,float baro_altitude_amsl);
+ const struct vehicle_gps_position_s &gps_position, float baro_altitude_amsl);
bool inside_polygon(double lat, double lon, float altitude);
int clearDm();
diff --git a/src/modules/position_estimator_inav/inertial_filter.c b/src/modules/position_estimator_inav/inertial_filter.c
index a36a4688d..c70cbeb0e 100644
--- a/src/modules/position_estimator_inav/inertial_filter.c
+++ b/src/modules/position_estimator_inav/inertial_filter.c
@@ -15,6 +15,7 @@ void inertial_filter_predict(float dt, float x[2], float acc)
if (!isfinite(acc)) {
acc = 0.0f;
}
+
x[0] += x[1] * dt + acc * dt * dt / 2.0f;
x[1] += acc * dt;
}
diff --git a/src/modules/px4iofirmware/sbus.c b/src/modules/px4iofirmware/sbus.c
index d76ec55f0..9d2849090 100644
--- a/src/modules/px4iofirmware/sbus.c
+++ b/src/modules/px4iofirmware/sbus.c
@@ -142,7 +142,7 @@ sbus1_output(uint16_t *values, uint16_t num_values)
value = (uint16_t)(((values[i] - SBUS_SCALE_OFFSET) / SBUS_SCALE_FACTOR) + .5f);
/*protect from out of bounds values and limit to 11 bits*/
- if (value > 0x07ff ) {
+ if (value > 0x07ff) {
value = 0x07ff;
}
diff --git a/src/modules/sensors/sensor_params.c b/src/modules/sensors/sensor_params.c
index 272e4b14f..1acc14fc6 100644
--- a/src/modules/sensors/sensor_params.c
+++ b/src/modules/sensors/sensor_params.c
@@ -682,7 +682,7 @@ PARAM_DEFINE_INT32(SENS_FLOW_ROT, 0);
*
* @group Sensor Calibration
*/
- PARAM_DEFINE_FLOAT(SENS_BOARD_Y_OFF, 0.0f);
+PARAM_DEFINE_FLOAT(SENS_BOARD_Y_OFF, 0.0f);
/**
* Board rotation X (Roll) offset
diff --git a/src/modules/systemlib/circuit_breaker.cpp b/src/modules/systemlib/circuit_breaker.cpp
index ea478a60f..f5ff0afd4 100644
--- a/src/modules/systemlib/circuit_breaker.cpp
+++ b/src/modules/systemlib/circuit_breaker.cpp
@@ -45,7 +45,7 @@
#include <px4.h>
#include <systemlib/circuit_breaker.h>
-bool circuit_breaker_enabled(const char* breaker, int32_t magic)
+bool circuit_breaker_enabled(const char *breaker, int32_t magic)
{
int32_t val;
(void)PX4_PARAM_GET_BYNAME(breaker, &val);
diff --git a/src/modules/systemlib/circuit_breaker.h b/src/modules/systemlib/circuit_breaker.h
index c97dbc26f..c76e6c37f 100644
--- a/src/modules/systemlib/circuit_breaker.h
+++ b/src/modules/systemlib/circuit_breaker.h
@@ -61,7 +61,7 @@
__BEGIN_DECLS
-extern "C" __EXPORT bool circuit_breaker_enabled(const char* breaker, int32_t magic);
+extern "C" __EXPORT bool circuit_breaker_enabled(const char *breaker, int32_t magic);
__END_DECLS
diff --git a/src/modules/systemlib/rc_check.h b/src/modules/systemlib/rc_check.h
index e70b83cce..035f63bef 100644
--- a/src/modules/systemlib/rc_check.h
+++ b/src/modules/systemlib/rc_check.h
@@ -39,7 +39,7 @@
#pragma once
- __BEGIN_DECLS
+__BEGIN_DECLS
/**
* Check the RC calibration
diff --git a/src/modules/uORB/topics/esc_status.h b/src/modules/uORB/topics/esc_status.h
index b45c49788..73fe0f936 100644
--- a/src/modules/uORB/topics/esc_status.h
+++ b/src/modules/uORB/topics/esc_status.h
@@ -92,7 +92,7 @@ struct esc_status_s {
struct {
enum ESC_VENDOR esc_vendor; /**< Vendor of current ESC */
uint32_t esc_errorcount; /**< Number of reported errors by ESC - if supported */
- int32_t esc_rpm; /**< Motor RPM, negative for reverse rotation [RPM] - if supported */
+ int32_t esc_rpm; /**< Motor RPM, negative for reverse rotation [RPM] - if supported */
float esc_voltage; /**< Voltage measured from current ESC [V] - if supported */
float esc_current; /**< Current measured from current ESC [A] - if supported */
float esc_temperature; /**< Temperature measured from current ESC [degC] - if supported */
diff --git a/src/modules/uORB/topics/fence.h b/src/modules/uORB/topics/fence.h
index a61f078ba..43cee89fe 100644
--- a/src/modules/uORB/topics/fence.h
+++ b/src/modules/uORB/topics/fence.h
@@ -65,7 +65,7 @@ struct fence_vertex_s {
* This is the position of a geofence
*
*/
-struct fence_s {
+struct fence_s {
unsigned count; /**< number of actual vertices */
struct fence_vertex_s vertices[GEOFENCE_MAX_VERTICES];
};
diff --git a/src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp b/src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp
index 7366d7fc6..125ceaddc 100644
--- a/src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp
+++ b/src/platforms/ros/nodes/demo_offboard_position_setpoints/demo_offboard_position_setpoints.cpp
@@ -66,6 +66,7 @@ int DemoOffboardPositionSetpoints::main()
pose.pose.position.z = 1;
_local_position_sp_pub.publish(pose);
}
+
return 0;
}
diff --git a/src/systemcmds/tests/test_jig_voltages.c b/src/systemcmds/tests/test_jig_voltages.c
index 98a105cb3..554125302 100644
--- a/src/systemcmds/tests/test_jig_voltages.c
+++ b/src/systemcmds/tests/test_jig_voltages.c
@@ -162,7 +162,7 @@ int test_jig_voltages(int argc, char *argv[])
errout_with_dev:
- if (fd != 0) close(fd);
+ if (fd != 0) { close(fd); }
return ret;
}
diff --git a/src/systemcmds/tests/test_rc.c b/src/systemcmds/tests/test_rc.c
index c9f9ef439..3a8144077 100644
--- a/src/systemcmds/tests/test_rc.c
+++ b/src/systemcmds/tests/test_rc.c
@@ -126,7 +126,7 @@ int test_rc(int argc, char *argv[])
warnx("TIMEOUT, less than 10 Hz updates");
(void)close(_rc_sub);
return ERROR;
- }
+ }
} else {
/* key pressed, bye bye */
diff --git a/src/systemcmds/tests/test_uart_send.c b/src/systemcmds/tests/test_uart_send.c
index 7e1e8d307..70a9c719e 100644
--- a/src/systemcmds/tests/test_uart_send.c
+++ b/src/systemcmds/tests/test_uart_send.c
@@ -95,7 +95,7 @@ int test_uart_send(int argc, char *argv[])
/* input handling */
char *uart_name = "/dev/ttyS3";
- if (argc > 1) uart_name = argv[1];
+ if (argc > 1) { uart_name = argv[1]; }
/* assuming NuttShell is on UART1 (/dev/ttyS0) */
int test_uart = open(uart_name, O_RDWR | O_NONBLOCK | O_NOCTTY); //
diff --git a/src/systemcmds/usb_connected/usb_connected.c b/src/systemcmds/usb_connected/usb_connected.c
index 98bbbc4be..530fee340 100644
--- a/src/systemcmds/usb_connected/usb_connected.c
+++ b/src/systemcmds/usb_connected/usb_connected.c
@@ -52,5 +52,5 @@ __EXPORT int usb_connected_main(int argc, char *argv[]);
int
usb_connected_main(int argc, char *argv[])
{
- return stm32_gpioread(GPIO_OTGFS_VBUS) ? 0:1;
+ return stm32_gpioread(GPIO_OTGFS_VBUS) ? 0 : 1;
}