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,12 +301,14 @@ 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)
|
||||||
const char* errored_check = HAL_VALIDATE_BOARD;
|
if((_options & SKIP_BOARD_VALIDATION) == 0) {
|
||||||
if (errored_check == nullptr) {
|
const char* errored_check = HAL_VALIDATE_BOARD;
|
||||||
return;
|
if (errored_check == nullptr) {
|
||||||
} else {
|
return;
|
||||||
config_error("Board Validation %s Failed", errored_check);
|
} else {
|
||||||
return;
|
config_error("Board Validation %s Failed", errored_check);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue