AP_Button: implement parameter CopyFieldsFrom and use it

This commit is contained in:
Peter Barker 2022-12-30 13:10:57 +11:00 committed by Andrew Tridgell
parent 80c79f1529
commit 7432123e42

View File

@ -101,31 +101,25 @@ const AP_Param::GroupInfo AP_Button::var_info[] = {
AP_GROUPINFO("OPTIONS4", 9, AP_Button, options[3], 0), AP_GROUPINFO("OPTIONS4", 9, AP_Button, options[3], 0),
// @Param: FUNC1 // @Param: FUNC1
// @CopyFieldsFrom: RC1_OPTION
// @DisplayName: Button Pin 1 RC Channel function // @DisplayName: Button Pin 1 RC Channel function
// @Description: Auxiliary RC Options function executed on pin change // @Description: Auxiliary RC Options function executed on pin change
// @CopyValuesFrom: RC1_OPTION
// @User: Standard // @User: Standard
AP_GROUPINFO("FUNC1", 10, AP_Button, pin_func[0], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING), AP_GROUPINFO("FUNC1", 10, AP_Button, pin_func[0], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING),
// @Param: FUNC2 // @Param: FUNC2
// @CopyFieldsFrom: BTN_FUNC1
// @DisplayName: Button Pin 2 RC Channel function // @DisplayName: Button Pin 2 RC Channel function
// @Description: Auxiliary RC Options function executed on pin change
// @CopyValuesFrom: RC1_OPTION
// @User: Standard
AP_GROUPINFO("FUNC2", 11, AP_Button, pin_func[1], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING), AP_GROUPINFO("FUNC2", 11, AP_Button, pin_func[1], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING),
// @Param: FUNC3 // @Param: FUNC3
// @CopyFieldsFrom: BTN_FUNC1
// @DisplayName: Button Pin 3 RC Channel function // @DisplayName: Button Pin 3 RC Channel function
// @Description: Auxiliary RC Options function executed on pin change
// @CopyValuesFrom: RC1_OPTION
// @User: Standard
AP_GROUPINFO("FUNC3", 12, AP_Button, pin_func[2], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING), AP_GROUPINFO("FUNC3", 12, AP_Button, pin_func[2], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING),
// @Param: FUNC4 // @Param: FUNC4
// @CopyFieldsFrom: BTN_FUNC1
// @DisplayName: Button Pin 4 RC Channel function // @DisplayName: Button Pin 4 RC Channel function
// @Description: Auxiliary RC Options function executed on pin change
// @CopyValuesFrom: RC1_OPTION
// @User: Standard
AP_GROUPINFO("FUNC4", 13, AP_Button, pin_func[3], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING), AP_GROUPINFO("FUNC4", 13, AP_Button, pin_func[3], (uint16_t)RC_Channel::AUX_FUNC::DO_NOTHING),
AP_GROUPEND AP_GROUPEND