diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-30 14:33:56 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-30 14:33:56 +0200 |
commit | 799f568ab48ca3446b24f41290589f7f3c39ef0f (patch) | |
tree | 209f0838987ef442e8de2f0996d4bf25684aa7db | |
parent | a5e7f5ca3051800d3bca3c10a6ecd531774fc781 (diff) | |
download | px4-firmware-799f568ab48ca3446b24f41290589f7f3c39ef0f.tar.gz px4-firmware-799f568ab48ca3446b24f41290589f7f3c39ef0f.tar.bz2 px4-firmware-799f568ab48ca3446b24f41290589f7f3c39ef0f.zip |
commander: Minor checks / improvements to power enforce patch
-rw-r--r-- | src/modules/commander/commander.cpp | 4 | ||||
-rw-r--r-- | src/modules/commander/state_machine_helper.cpp | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 507f18e24..a15712a91 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -974,8 +974,10 @@ int commander_thread_main(int argc, char *argv[]) status.condition_power_input_valid = false; } else { status.condition_power_input_valid = true; - status.avionics_power_rail_voltage = system_power.voltage5V_v; } + + /* copy avionics voltage */ + status.avionics_power_rail_voltage = system_power.voltage5V_v; } } diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 1997729d4..7a61d481b 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -141,22 +141,16 @@ arming_state_transition(struct vehicle_status_s *status, /// current // Fail transition if power is not good if (!status->condition_power_input_valid) { - if (mavlink_fd) { - mavlink_log_critical(mavlink_fd, "#audio: NOT ARMING: Connect power module."); - } - + mavlink_log_critical(mavlink_fd, "#audio: NOT ARMING: Connect power module."); valid_transition = false; } // Fail transition if power levels on the avionics rail - // are insufficient - if ((status->avionics_power_rail_voltage > 0.0f) && - (status->avionics_power_rail_voltage < 4.5f)) { - - if (mavlink_fd) { - mavlink_log_critical(mavlink_fd, "#audio: NOT ARMING: Avionics power low: %6.2f V.", status->avionics_power_rail_voltage); - } + // are measured but are insufficient + if (status->condition_power_input_valid && (status->avionics_power_rail_voltage > 0.0f) && + (status->avionics_power_rail_voltage < 4.9f)) { + mavlink_log_critical(mavlink_fd, "#audio: NOT ARMING: Avionics power low: %6.2f V.", status->avionics_power_rail_voltage); valid_transition = false; } } |