Tools:AP_Bootloader: fix check good firmware define

This commit is contained in:
Huibean
2025-11-25 12:11:54 +11:00
committed by Andrew Tridgell
parent b36b6cda33
commit 2e79c28ffd
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -336,7 +336,11 @@ static void handle_file_read_response(CanardInstance* ins, CanardRxTransfer* tra
fw_update.node_id = 0;
flash_write_flush();
flash_set_keep_unlocked(false);
#if AP_CHECK_FIRMWARE_ENABLED
const auto ok = check_good_firmware();
#else
const auto ok = check_fw_result_t::CHECK_FW_OK;
#endif
node_status.vendor_specific_status_code = uint8_t(ok);
if (ok == check_fw_result_t::CHECK_FW_OK) {
jump_to_app();
@@ -805,7 +809,11 @@ bool can_check_update(void)
void can_start()
{
#if AP_CHECK_FIRMWARE_ENABLED
node_status.vendor_specific_status_code = uint8_t(check_good_firmware());
#else
node_status.vendor_specific_status_code = uint8_t(check_fw_result_t::CHECK_FW_OK);
#endif
node_status.mode = UAVCAN_PROTOCOL_NODESTATUS_MODE_MAINTENANCE;
#if HAL_USE_CAN
+4
View File
@@ -463,7 +463,11 @@ void BL_Network::handle_post(SocketAPM *sock, uint32_t content_length)
}
flash_write_flush();
flash_set_keep_unlocked(false);
#if AP_CHECK_FIRMWARE_ENABLED
const auto ok = check_good_firmware();
#else
const auto ok = check_fw_result_t::CHECK_FW_OK;
#endif
if (ok == check_fw_result_t::CHECK_FW_OK) {
need_launch = true;
status_printf("Flash done: OK");