mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_BoardConfig: added BRD_OPTIONS flag for setting of internal parameters
this allows us to make parameters read-only for normal use, but for special developer requirements the user can unlock the parameters at their own risk
This commit is contained in:
parent
c731e77607
commit
f543c483fc
@ -270,7 +270,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
|
|||||||
// @Param: OPTIONS
|
// @Param: OPTIONS
|
||||||
// @DisplayName: Board options
|
// @DisplayName: Board options
|
||||||
// @Description: Board specific option flags
|
// @Description: Board specific option flags
|
||||||
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp
|
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters
|
||||||
// @User: Advanced
|
// @User: Advanced
|
||||||
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),
|
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),
|
||||||
|
|
||||||
|
@ -165,6 +165,7 @@ public:
|
|||||||
enum board_options {
|
enum board_options {
|
||||||
BOARD_OPTION_WATCHDOG = (1 << 0),
|
BOARD_OPTION_WATCHDOG = (1 << 0),
|
||||||
DISABLE_FTP = (1<<1),
|
DISABLE_FTP = (1<<1),
|
||||||
|
ALLOW_SET_INTERNAL_PARM = (1<<2),
|
||||||
};
|
};
|
||||||
|
|
||||||
// return true if ftp is disabled
|
// return true if ftp is disabled
|
||||||
@ -177,6 +178,11 @@ public:
|
|||||||
return _singleton?(_singleton->_options & BOARD_OPTION_WATCHDOG)!=0:HAL_WATCHDOG_ENABLED_DEFAULT;
|
return _singleton?(_singleton->_options & BOARD_OPTION_WATCHDOG)!=0:HAL_WATCHDOG_ENABLED_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return true if we allow setting of internal parameters (for developers)
|
||||||
|
static bool allow_set_internal_parameters(void) {
|
||||||
|
return _singleton?(_singleton->_options & ALLOW_SET_INTERNAL_PARM)!=0:false;
|
||||||
|
}
|
||||||
|
|
||||||
// handle press of safety button. Return true if safety state
|
// handle press of safety button. Return true if safety state
|
||||||
// should be toggled
|
// should be toggled
|
||||||
bool safety_button_handle_pressed(uint8_t press_count);
|
bool safety_button_handle_pressed(uint8_t press_count);
|
||||||
|
Loading…
Reference in New Issue
Block a user