Copter: Sprayer enable added to CH7/CH8 switch
This commit is contained in:
parent
c7464f635c
commit
e1fe4946fb
@ -98,6 +98,7 @@ static void init_aux_switches()
|
|||||||
case AUX_SWITCH_RESETTOARMEDYAW:
|
case AUX_SWITCH_RESETTOARMEDYAW:
|
||||||
case AUX_SWITCH_SUPERSIMPLE_MODE:
|
case AUX_SWITCH_SUPERSIMPLE_MODE:
|
||||||
case AUX_SWITCH_ACRO_TRAINER:
|
case AUX_SWITCH_ACRO_TRAINER:
|
||||||
|
case AUX_SWITCH_SPRAYER:
|
||||||
do_aux_switch_function(g.ch7_option, ap_system.CH7_flag);
|
do_aux_switch_function(g.ch7_option, ap_system.CH7_flag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -109,6 +110,7 @@ static void init_aux_switches()
|
|||||||
case AUX_SWITCH_RESETTOARMEDYAW:
|
case AUX_SWITCH_RESETTOARMEDYAW:
|
||||||
case AUX_SWITCH_SUPERSIMPLE_MODE:
|
case AUX_SWITCH_SUPERSIMPLE_MODE:
|
||||||
case AUX_SWITCH_ACRO_TRAINER:
|
case AUX_SWITCH_ACRO_TRAINER:
|
||||||
|
case AUX_SWITCH_SPRAYER:
|
||||||
do_aux_switch_function(g.ch8_option, ap_system.CH8_flag);
|
do_aux_switch_function(g.ch8_option, ap_system.CH8_flag);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -260,6 +262,12 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
|
|||||||
g.acro_trainer = ACRO_TRAINER_LIMITED;
|
g.acro_trainer = ACRO_TRAINER_LIMITED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if SPRAYER == ENABLED
|
||||||
|
case AUX_SWITCH_SPRAYER:
|
||||||
|
sprayer.enable(ch_flag == AUX_SWITCH_HIGH);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
#define AUX_SWITCH_RESETTOARMEDYAW 12 // changes yaw to be same as when quad was armed
|
#define AUX_SWITCH_RESETTOARMEDYAW 12 // changes yaw to be same as when quad was armed
|
||||||
#define AUX_SWITCH_SUPERSIMPLE_MODE 13 // change to simple mode in middle, super simple at top
|
#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_ACRO_TRAINER 14 // low = disabled, middle = leveled, high = leveled and limited
|
||||||
|
#define AUX_SWITCH_SPRAYER 15 // enable/disable the crop sprayer
|
||||||
|
|
||||||
// values used by the ap.ch7_opt and ap.ch8_opt flags
|
// 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)
|
#define AUX_SWITCH_LOW 0 // indicates auxiliar switch is in the low position (pwm <1200)
|
||||||
|
Loading…
Reference in New Issue
Block a user