mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 08:20:34 +08:00
Fixed style issue with Astyle 3.1
This commit is contained in:
@@ -132,7 +132,7 @@ int BBBlueADC::init()
|
||||
}
|
||||
|
||||
_measure(); // start the initial conversion so that the test command right
|
||||
// after the start command can return values
|
||||
// after the start command can return values
|
||||
return PX4_OK;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ int bbblue_adc_main(int argc, char *argv[])
|
||||
|
||||
for (int i = BBBLUE_MAX_ADC_USER_CHANNELS; i < BBBLUE_MAX_ADC_CHANNELS; ++i) {
|
||||
PX4_INFO("ADC channel: %d; value: %d, voltage: %6.2f V", (int)adc_msgs[i].am_channel,
|
||||
adc_msgs[i].am_data, adc_msgs[i].am_data* 1.8/4095.0 * 11.0);
|
||||
adc_msgs[i].am_data, adc_msgs[i].am_data * 1.8 / 4095.0 * 11.0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void rc_cleaning(void);
|
||||
/**
|
||||
* struct to hold the data retreived during one read of the barometer.
|
||||
*/
|
||||
typedef struct rc_bmp_data_t{
|
||||
typedef struct rc_bmp_data_t {
|
||||
float temp_c; ///< temperature in degrees celcius
|
||||
float alt_m; ///< altitude in meters
|
||||
float pressure_pa; ///< current pressure in pascals
|
||||
@@ -109,7 +109,7 @@ typedef struct rc_bmp_data_t{
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int rc_bmp_read(rc_bmp_data_t* data);
|
||||
int rc_bmp_read(rc_bmp_data_t *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ int rc_init(void)
|
||||
return rc_initialize();
|
||||
#else
|
||||
#ifdef __DF_BBBLUE
|
||||
|
||||
if (rc_get_state() == RUNNING) { return 0; }
|
||||
|
||||
PX4_INFO("Initializing Robotics Cape library ...");
|
||||
@@ -88,7 +89,7 @@ int rc_init(void)
|
||||
PX4_ERR("rc_init failed to set default pinmux");
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
// no direct equivalent of configure_gpio_pins()
|
||||
|
||||
@@ -102,7 +103,7 @@ int rc_init(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(rc_servo_power_rail_en(1)) { // Turning On 6V Servo Power Rail
|
||||
if (rc_servo_power_rail_en(1)) { // Turning On 6V Servo Power Rail
|
||||
PX4_ERR("rc_init failed to run rc_servo_power_rail_en(1)");
|
||||
return -1;
|
||||
}
|
||||
@@ -126,6 +127,7 @@ void rc_cleaning(void)
|
||||
rc_cleanup(); return ;
|
||||
#else
|
||||
#ifdef __DF_BBBLUE
|
||||
|
||||
if (rc_get_state() == EXITING) { return; }
|
||||
|
||||
rc_set_state(EXITING);
|
||||
@@ -142,7 +144,8 @@ void rc_cleaning(void)
|
||||
|
||||
|
||||
#ifdef __RC_V0_3
|
||||
int rc_bmp_read(rc_bmp_data_t* data) {
|
||||
int rc_bmp_read(rc_bmp_data_t *data)
|
||||
{
|
||||
int rtn = rc_read_barometer();
|
||||
|
||||
data->temp_c = rc_bmp_get_temperature();
|
||||
|
||||
@@ -73,7 +73,7 @@ int BBBlueRcPWMOut::send_output_pwm(const uint16_t *pwm, int num_outputs)
|
||||
|
||||
// pwm[ch] is duty_cycle in us
|
||||
for (int ch = 0; ch < num_outputs; ++ch) {
|
||||
ret += rc_servo_send_pulse_us(ch+1, pwm[ch]); // converts to 1-based channel #
|
||||
ret += rc_servo_send_pulse_us(ch + 1, pwm[ch]); // converts to 1-based channel #
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -235,6 +235,7 @@ void task_main(int argc, char *argv[])
|
||||
pwm_out = new OcpocMmapPWMOut(_max_num_outputs);
|
||||
|
||||
#ifdef __DF_BBBLUE
|
||||
|
||||
} else if (strcmp(_protocol, "bbblue_rc") == 0) {
|
||||
PX4_INFO("Starting PWM output in bbblue_rc mode");
|
||||
pwm_out = new BBBlueRcPWMOut(_max_num_outputs);
|
||||
|
||||
@@ -42,7 +42,7 @@ int RcInput::init()
|
||||
/**
|
||||
* initialize the data of each channel
|
||||
*/
|
||||
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS && i<16; ++i) {
|
||||
for (i = 0; i < input_rc_s::RC_INPUT_MAX_CHANNELS && i < 16; ++i) {
|
||||
//_data.values defined as int[16] and RC_INPUT_MAX_CHANNELS (=18) > 16
|
||||
_data.values[i] = UINT16_MAX;
|
||||
}
|
||||
|
||||
@@ -1150,9 +1150,11 @@ Mavlink::find_broadcast_address()
|
||||
const struct in_addr netmask_addr = query_netmask_addr(_socket_fd, *cur_ifreq);
|
||||
const struct in_addr broadcast_addr = compute_broadcast_addr(sin_addr, netmask_addr);
|
||||
|
||||
#ifdef __PX4_POSIX_BBBLUE
|
||||
#ifdef __PX4_POSIX_BBBLUE
|
||||
|
||||
if (strstr(cur_ifreq->ifr_name, _mavlink_wifi_name) == NULL) { continue; }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
PX4_INFO("using network interface %s, IP: %s", cur_ifreq->ifr_name, inet_ntoa(sin_addr));
|
||||
PX4_INFO("with netmask: %s", inet_ntoa(netmask_addr));
|
||||
|
||||
@@ -609,7 +609,7 @@ private:
|
||||
#endif
|
||||
|
||||
#ifdef __PX4_POSIX_BBBLUE
|
||||
const char * _mavlink_wifi_name;
|
||||
const char *_mavlink_wifi_name;
|
||||
#endif
|
||||
|
||||
int _socket_fd;
|
||||
|
||||
@@ -161,7 +161,7 @@ int DfBmp280Wrapper::_publish(struct baro_sensor_data &data)
|
||||
|
||||
baro_report.pressure = data.pressure_pa / 100.0f; // to mbar
|
||||
baro_report.temperature = data.temperature_c;
|
||||
|
||||
|
||||
// TODO: when is this ever blocked?
|
||||
if (!(m_pub_blocked)) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user