Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APBoardConfig: Add skip validate board #23620

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.cpp
Expand Up @@ -287,7 +287,7 @@ const AP_Param::GroupInfo AP_BoardConfig::var_info[] = {
// @Param: OPTIONS
// @DisplayName: Board options
// @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
AP_GROUPINFO("OPTIONS", 19, AP_BoardConfig, _options, HAL_BRD_OPTIONS_DEFAULT),

Expand Down
1 change: 1 addition & 0 deletions libraries/AP_BoardConfig/AP_BoardConfig.h
Expand Up @@ -142,6 +142,7 @@ class AP_BoardConfig {
UNLOCK_FLASH = (1<<4),
WRITE_PROTECT_FLASH = (1<<5),
WRITE_PROTECT_BOOTLOADER = (1<<6),
SKIP_BOARD_VALIDATION = (1<<7)
};

// return true if ftp is disabled
Expand Down
14 changes: 8 additions & 6 deletions libraries/AP_BoardConfig/board_drivers.cpp
Expand Up @@ -301,12 +301,14 @@ void AP_BoardConfig::validate_board_type(void)
void AP_BoardConfig::board_autodetect(void)
{
#if defined(HAL_VALIDATE_BOARD)
const char* errored_check = HAL_VALIDATE_BOARD;
if (errored_check == nullptr) {
return;
} else {
config_error("Board Validation %s Failed", errored_check);
return;
if((_options & SKIP_BOARD_VALIDATION) == 0) {
const char* errored_check = HAL_VALIDATE_BOARD;
if (errored_check == nullptr) {
return;
} else {
config_error("Board Validation %s Failed", errored_check);
return;
}
}
#endif

Expand Down