aboutsummaryrefslogtreecommitdiff
path: root/apps/commander/commander.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-08-18 16:48:43 +0200
committerLorenz Meier <lm@inf.ethz.ch>2012-08-18 16:48:43 +0200
commitdc484c1d21fcb7bc4f4be97853647321e8a147e1 (patch)
tree4b51a2ff911967318d725bf58bed77b1247468b5 /apps/commander/commander.c
parente707574f73b8ed0e9103fd999bd43847c657b5e1 (diff)
downloadpx4-firmware-dc484c1d21fcb7bc4f4be97853647321e8a147e1.tar.gz
px4-firmware-dc484c1d21fcb7bc4f4be97853647321e8a147e1.tar.bz2
px4-firmware-dc484c1d21fcb7bc4f4be97853647321e8a147e1.zip
State machine cleanup, introduced variable rates for MAVLink depending on the baud rate
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r--apps/commander/commander.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c
index 47829ddf5..149a662fd 100644
--- a/apps/commander/commander.c
+++ b/apps/commander/commander.c
@@ -95,10 +95,7 @@ static int leds;
static int buzzer;
static int mavlink_fd;
static bool commander_initialized = false;
-static struct vehicle_status_s current_status = {
- .state_machine = SYSTEM_STATE_PREFLIGHT,
- .mode = 0
-}; /**< Main state machine */
+static struct vehicle_status_s current_status; /**< Main state machine */
static int stat_pub;
static uint16_t nofix_counter = 0;
@@ -798,6 +795,7 @@ int commander_main(int argc, char *argv[])
/* make sure we are in preflight state */
memset(&current_status, 0, sizeof(current_status));
current_status.state_machine = SYSTEM_STATE_PREFLIGHT;
+ current_status.flag_system_armed = false;
/* advertise to ORB */
stat_pub = orb_advertise(ORB_ID(vehicle_status), &current_status);
@@ -905,8 +903,8 @@ int commander_main(int argc, char *argv[])
}
/* toggle error led at 5 Hz in HIL mode */
- if ((current_status.mode & VEHICLE_MODE_FLAG_HIL_ENABLED)) {
- /* armed */
+ if (current_status.flag_hil_enabled) {
+ /* hil enabled */
led_toggle(LED_AMBER);
} else if (bat_remain < 0.3f && (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT)) {