mirror of https://github.com/ArduPilot/ardupilot
AP_BoardConfig: Added ignore board validation
Added the ability to ignore board validation. This has been added to the 7th bit in BRD_OPTIONS
This commit is contained in:
parent
530e665c4d
commit
10038a64be
|
@ -287,7 +287,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, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot
|
// @Bitmask: 0:Enable hardware watchdog, 1:Disable MAVftp, 2:Enable set of internal parameters, 3:Enable Debug Pins, 4:Unlock flash on reboot, 5:Write protect firmware flash on reboot, 6:Write protect bootloader flash on reboot, 7:Skip board validation
|
||||||
// @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),
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,7 @@ public:
|
||||||
UNLOCK_FLASH = (1<<4),
|
UNLOCK_FLASH = (1<<4),
|
||||||
WRITE_PROTECT_FLASH = (1<<5),
|
WRITE_PROTECT_FLASH = (1<<5),
|
||||||
WRITE_PROTECT_BOOTLOADER = (1<<6),
|
WRITE_PROTECT_BOOTLOADER = (1<<6),
|
||||||
|
SKIP_BOARD_VALIDATION = (1<<7)
|
||||||
};
|
};
|
||||||
|
|
||||||
// return true if ftp is disabled
|
// return true if ftp is disabled
|
||||||
|
|
|
@ -301,6 +301,7 @@ void AP_BoardConfig::validate_board_type(void)
|
||||||
void AP_BoardConfig::board_autodetect(void)
|
void AP_BoardConfig::board_autodetect(void)
|
||||||
{
|
{
|
||||||
#if defined(HAL_VALIDATE_BOARD)
|
#if defined(HAL_VALIDATE_BOARD)
|
||||||
|
if((_options & SKIP_BOARD_VALIDATION) == 0) {
|
||||||
const char* errored_check = HAL_VALIDATE_BOARD;
|
const char* errored_check = HAL_VALIDATE_BOARD;
|
||||||
if (errored_check == nullptr) {
|
if (errored_check == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -308,6 +309,7 @@ void AP_BoardConfig::board_autodetect(void)
|
||||||
config_error("Board Validation %s Failed", errored_check);
|
config_error("Board Validation %s Failed", errored_check);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (state.board_type != PX4_BOARD_AUTO) {
|
if (state.board_type != PX4_BOARD_AUTO) {
|
||||||
|
|
Loading…
Reference in New Issue