diff options
author | Holger Steinhaus <holger@steinhaus-home.de> | 2014-11-12 09:52:35 +0100 |
---|---|---|
committer | Holger Steinhaus <holger@steinhaus-home.de> | 2014-11-12 10:10:37 +0100 |
commit | 7bc9a6257731a741ff309f060f6cf87c33c4a266 (patch) | |
tree | 19227893b21942457baedf18b898d6b43cfed0ca /src/modules | |
parent | 0800fa4715994921b6a0d15cd2c44b9e51417117 (diff) | |
download | px4-firmware-7bc9a6257731a741ff309f060f6cf87c33c4a266.tar.gz px4-firmware-7bc9a6257731a741ff309f060f6cf87c33c4a266.tar.bz2 px4-firmware-7bc9a6257731a741ff309f060f6cf87c33c4a266.zip |
code style, warnings
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/uavcan/actuators/esc.cpp | 13 | ||||
-rw-r--r-- | src/modules/uavcan/uavcan_main.cpp | 9 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/modules/uavcan/actuators/esc.cpp b/src/modules/uavcan/actuators/esc.cpp index fbd4f0bcd..1d23099f3 100644 --- a/src/modules/uavcan/actuators/esc.cpp +++ b/src/modules/uavcan/actuators/esc.cpp @@ -113,8 +113,7 @@ void UavcanEscController::update_outputs(float *outputs, unsigned num_outputs) msg.cmd.push_back(static_cast<int>(scaled)); _esc_status.esc[i].esc_setpoint_raw = abs(static_cast<int>(scaled)); - } - else { + } else { msg.cmd.push_back(static_cast<unsigned>(0)); } } @@ -128,18 +127,20 @@ void UavcanEscController::update_outputs(float *outputs, unsigned num_outputs) void UavcanEscController::arm_all_escs(bool arm) { - if (arm) + if (arm) { _armed_mask = -1; - else + } else { _armed_mask = 0; + } } void UavcanEscController::arm_single_esc(int num, bool arm) { - if (arm) + if (arm) { _armed_mask = MOTOR_BIT(num); - else + } else { _armed_mask = 0; + } } void UavcanEscController::esc_status_sub_cb(const uavcan::ReceivedDataStructure<uavcan::equipment::esc::Status> &msg) diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index 653d4f98c..2c543462e 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -346,13 +346,12 @@ int UavcanNode::run() // can we mix? if (_test_in_progress) { - float outputs[NUM_ACTUATOR_OUTPUTS] = {}; - outputs[_test_motor.motor_number] = _test_motor.value*2.0f-1.0f; + float test_outputs[NUM_ACTUATOR_OUTPUTS] = {}; + test_outputs[_test_motor.motor_number] = _test_motor.value*2.0f-1.0f; // Output to the bus - _esc_controller.update_outputs(outputs, NUM_ACTUATOR_OUTPUTS); - } - else if (controls_updated && (_mixers != nullptr)) { + _esc_controller.update_outputs(test_outputs, NUM_ACTUATOR_OUTPUTS); + } else if (controls_updated && (_mixers != nullptr)) { // XXX one output group has 8 outputs max, // but this driver could well serve multiple groups. |