AP_BoardConfig: add Board option to disable MAVftp in low mem bds/apps

This commit is contained in:
Hwurzburg 2020-11-13 19:54:07 -06:00 committed by Andrew Tridgell
parent 9c74474196
commit 6fe5ed36ce
2 changed files with 7 additions and 1 deletions

View File

@ -270,7 +270,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Param: OPTIONS
// @DisplayName: Board options
// @Description: Board specific option flags
// @Bitmask: 0:Enable hardware watchdog
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp
// @User: Advanced
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),

View File

@ -164,8 +164,14 @@ public:
enum board_options {
BOARD_OPTION_WATCHDOG = (1 << 0),
DISABLE_FTP = (1<<1),
};
// return true if ftp is disabled
static bool ftp_disabled(void) {
return _singleton?(_singleton->_options & DISABLE_FTP)!=0:1;
}
// return true if watchdog enabled
static bool watchdog_enabled(void) {
return _singleton?(_singleton->_options & BOARD_OPTION_WATCHDOG)!=0:HAL_WATCHDOG_ENABLED_DEFAULT;