mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-08 02:17:07 +08:00
Use new data for mode changes
This commit is contained in:
@@ -2944,13 +2944,13 @@ set_main_state_rc(struct vehicle_status_s *status_local, struct manual_control_s
|
||||
}
|
||||
|
||||
/* we know something has changed - check if we are in mode slot operation */
|
||||
if (_last_sp_man.mode_slot > 0) {
|
||||
if (sp_man->mode_slot > 0) {
|
||||
|
||||
if (_last_sp_man.mode_slot >= sizeof(_flight_mode_slots) / sizeof(_flight_mode_slots[0])) {
|
||||
if (sp_man->mode_slot >= sizeof(_flight_mode_slots) / sizeof(_flight_mode_slots[0])) {
|
||||
return TRANSITION_DENIED;
|
||||
}
|
||||
|
||||
int new_mode = _flight_mode_slots[_last_sp_man.mode_slot];
|
||||
int new_mode = _flight_mode_slots[sp_man->mode_slot];
|
||||
|
||||
if (new_mode < 0) {
|
||||
/* slot is unused */
|
||||
|
||||
Reference in New Issue
Block a user