Two hacks here to make it compile

This commit is contained in:
Julian Oes 2013-06-12 12:47:00 +02:00
parent 7f90ebf537
commit ec08dec8ba
2 changed files with 17 additions and 10 deletions

View File

@ -171,7 +171,8 @@ void gpio_led_cycle(FAR void *arg)
/* select pattern for current status */
int pattern = 0;
if (priv->status.flag_system_armed) {
/* XXX fmu armed correct? */
if (priv->status.flag_fmu_armed) {
if (priv->status.battery_warning == VEHICLE_BATTERY_WARNING_NONE) {
pattern = 0x3f; // ****** solid (armed)
@ -180,10 +181,10 @@ void gpio_led_cycle(FAR void *arg)
}
} else {
if (priv->status.state_machine == SYSTEM_STATE_PREFLIGHT) {
if (priv->status.arming_state == ARMING_STATE_STANDBY) {
pattern = 0x00; // ______ off (disarmed, preflight check)
} else if (priv->status.state_machine == SYSTEM_STATE_STANDBY &&
} else if (priv->status.arming_state == ARMING_STATE_STANDBY &&
priv->status.battery_warning == VEHICLE_BATTERY_WARNING_NONE) {
pattern = 0x38; // ***___ slow blink (disarmed, ready)

View File

@ -861,11 +861,16 @@ int sdlog2_thread_main(int argc, char *argv[])
if (fds[ifds++].revents & POLLIN) {
// Don't orb_copy, it's already done few lines above
log_msg.msg_type = LOG_STAT_MSG;
log_msg.body.log_STAT.state = (unsigned char) buf_status.state_machine;
log_msg.body.log_STAT.flight_mode = (unsigned char) buf_status.flight_mode;
log_msg.body.log_STAT.manual_control_mode = (unsigned char) buf_status.manual_control_mode;
log_msg.body.log_STAT.manual_sas_mode = (unsigned char) buf_status.manual_sas_mode;
log_msg.body.log_STAT.armed = (unsigned char) buf_status.flag_system_armed;
// XXX fix this
// log_msg.body.log_STAT.state = (unsigned char) buf_status.state_machine;
// log_msg.body.log_STAT.flight_mode = (unsigned char) buf_status.flight_mode;
// log_msg.body.log_STAT.manual_control_mode = (unsigned char) buf_status.manual_control_mode;
// log_msg.body.log_STAT.manual_sas_mode = (unsigned char) buf_status.manual_sas_mode;
log_msg.body.log_STAT.state = 0;
log_msg.body.log_STAT.flight_mode = 0;
log_msg.body.log_STAT.manual_control_mode = 0;
log_msg.body.log_STAT.manual_sas_mode = 0;
log_msg.body.log_STAT.armed = (unsigned char) buf_status.flag_fmu_armed; /* XXX fmu armed correct? */
log_msg.body.log_STAT.battery_voltage = buf_status.voltage_battery;
log_msg.body.log_STAT.battery_current = buf_status.current_battery;
log_msg.body.log_STAT.battery_remaining = buf_status.battery_remaining;
@ -1165,8 +1170,9 @@ void handle_command(struct vehicle_command_s *cmd)
void handle_status(struct vehicle_status_s *status)
{
if (status->flag_system_armed != flag_system_armed) {
flag_system_armed = status->flag_system_armed;
/* XXX fmu armed correct? */
if (status->flag_fmu_armed != flag_system_armed) {
flag_system_armed = status->flag_fmu_armed;
if (flag_system_armed) {
sdlog2_start_log();