mirror of https://github.com/ArduPilot/ardupilot
AP_BoardConfig: added BRD_OPTIONS
used to enable STM32 watchdog # Conflicts: # libraries/AP_BoardConfig/AP_BoardConfig.cpp # libraries/AP_BoardConfig/AP_BoardConfig.h
This commit is contained in:
parent
a7906f9e42
commit
78e234bb6f
|
@ -97,6 +97,14 @@
|
||||||
#define BOARD_PWM_COUNT_DEFAULT 8
|
#define BOARD_PWM_COUNT_DEFAULT 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAL_BRD_OPTIONS_DEFAULT
|
||||||
|
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||||
|
#define HAL_BRD_OPTIONS_DEFAULT BOARD_OPTION_WATCHDOG
|
||||||
|
#else
|
||||||
|
#define HAL_BRD_OPTIONS_DEFAULT 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern const AP_HAL::HAL& hal;
|
extern const AP_HAL::HAL& hal;
|
||||||
AP_BoardConfig *AP_BoardConfig::instance;
|
AP_BoardConfig *AP_BoardConfig::instance;
|
||||||
|
|
||||||
|
@ -233,6 +241,13 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
|
||||||
AP_GROUPINFO("SD_SLOWDOWN", 17, AP_BoardConfig, _sdcard_slowdown, 0),
|
AP_GROUPINFO("SD_SLOWDOWN", 17, AP_BoardConfig, _sdcard_slowdown, 0),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// @Param: OPTIONS
|
||||||
|
// @DisplayName: Board options
|
||||||
|
// @Description: Board specific option flags
|
||||||
|
// @Bitmask: 0:Enable hardware watchdog
|
||||||
|
// @User: Advanced
|
||||||
|
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),
|
||||||
|
|
||||||
AP_GROUPEND
|
AP_GROUPEND
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -155,6 +155,15 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum board_options {
|
||||||
|
BOARD_OPTION_WATCHDOG = (1 << 0),
|
||||||
|
};
|
||||||
|
|
||||||
|
// return true if watchdog enabled
|
||||||
|
static bool watchdog_enabled(void) {
|
||||||
|
return _singleton?(_singleton->_options & BOARD_OPTION_WATCHDOG)!=0:false;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static AP_BoardConfig *instance;
|
static AP_BoardConfig *instance;
|
||||||
|
|
||||||
|
@ -226,4 +235,6 @@ private:
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
|
||||||
AP_Int8 _sdcard_slowdown;
|
AP_Int8 _sdcard_slowdown;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
AP_Int32 _options;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue