Copter: add ch7/ch8 Auto and Land option
CH7/CH8 high initiates AUTO mode, low initiates Land. Ideally high would be a new take-off flight mode so this may need some rework.
This commit is contained in:
parent
ac620e2140
commit
69da4e99f8
@ -268,6 +268,17 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
|
||||
sprayer.enable(ch_flag == AUX_SWITCH_HIGH);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case AUX_SWITCH_AUTO_AND_LAND:
|
||||
switch(ch_flag) {
|
||||
case AUX_SWITCH_LOW:
|
||||
case AUX_SWITCH_MIDDLE:
|
||||
set_mode(LAND);
|
||||
break;
|
||||
case AUX_SWITCH_HIGH:
|
||||
set_mode(AUTO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@
|
||||
#define AUX_SWITCH_SUPERSIMPLE_MODE 13 // change to simple mode in middle, super simple at top
|
||||
#define AUX_SWITCH_ACRO_TRAINER 14 // low = disabled, middle = leveled, high = leveled and limited
|
||||
#define AUX_SWITCH_SPRAYER 15 // enable/disable the crop sprayer
|
||||
#define AUX_SWITCH_AUTO_AND_LAND 16 // switch enabled auto (high) or land (low) flight modes
|
||||
|
||||
// values used by the ap.ch7_opt and ap.ch8_opt flags
|
||||
#define AUX_SWITCH_LOW 0 // indicates auxiliar switch is in the low position (pwm <1200)
|
||||
|
Loading…
Reference in New Issue
Block a user