int game() { game_state = NOTCONNECTED; move_home(); game_state = state_notconnected(); while(1) { if(game_state == NOTCONNECTED) { Debug_UART_PutString("Attempting to connect again.\n"); state_notconnected(); } else if(game_state == CONNECTED) { state_connected(); } else if(game_state == READY) { state_ready(); } else if(game_state == WAITING) { state_waiting(); } else if(game_state == MOVING) { state_moving(); } } }
bool TaskAdvanceLegacy::ready_to_advance(const TaskPoint &tp, const AIRCRAFT_STATE &state, const bool x_enter, const bool x_exit) { const bool m_mode_ready = mode_ready(tp); const bool m_state_ready = state_ready(tp, state, x_enter, x_exit); if ((mode==ADVANCE_ARM) || (mode==ADVANCE_ARMSTART)) { if (m_state_ready && !m_mode_ready) { m_request_armed = true; } if (m_armed) { m_request_armed = false; } } return m_mode_ready && m_state_ready; }