Skip to content
Snippets Groups Projects
Commit 53acb324 authored by Jason Short's avatar Jason Short
Browse files

ACM: Restore Multi-mode support

parent e13cea03
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,22 @@ static void read_trim_switch()
// set the ch7 flag
ap_system.CH7_flag = (g.rc_7.radio_in >= CH7_PWM_TRIGGER);
switch(g.ch7_option) {
// multi-mode
int8_t option;
if(g.ch7_option == CH7_MULTI_MODE) {
if (g.rc_6.radio_in < CH6_PWM_TRIGGER_LOW) {
option = CH7_FLIP;
}else if (g.rc_6.radio_in > CH6_PWM_TRIGGER_HIGH) {
option = CH7_SAVE_WP;
}else{
option = CH7_RTL;
}
}else{
option = g.ch7_option;
}
switch(option) {
case CH7_FLIP:
// flip if switch is on, positive throttle and we're actually flying
if(ap_system.CH7_flag && g.rc_3.control_in >= 0 && ap.takeoff_complete) {
......
......@@ -51,6 +51,9 @@
// CH 7 control
#define CH7_PWM_TRIGGER 1800 // pwm value above which the channel 7 option will be invoked
#define CH6_PWM_TRIGGER_HIGH 1800
#define CH6_PWM_TRIGGER_LOW 1200
#define CH7_DO_NOTHING 0
#define CH7_SET_HOVER 1 // deprecated
#define CH7_FLIP 2
......@@ -59,10 +62,11 @@
#define CH7_SAVE_TRIM 5
#define CH7_ADC_FILTER 6 // deprecated
#define CH7_SAVE_WP 7
#define CH7_MULTI_MODE 8 // deprecated
#define CH7_MULTI_MODE 8
#define CH7_CAMERA_TRIGGER 9
// Frame types
#define QUAD_FRAME 0
#define TRI_FRAME 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment