From 635acc370f04cc52427d660e1d8e9b7dfcc2920f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 18 Aug 2022 20:54:36 +1000 Subject: [PATCH] AP_Periph: use AP_CheckFirmware # Conflicts: # Tools/AP_Periph/wscript --- Tools/AP_Periph/AP_Periph.cpp | 16 +--------------- Tools/AP_Periph/AP_Periph.h | 1 + Tools/AP_Periph/can.cpp | 1 - Tools/AP_Periph/wscript | 1 + 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Tools/AP_Periph/AP_Periph.cpp b/Tools/AP_Periph/AP_Periph.cpp index 8364ec59fb..0aa87cc9c0 100644 --- a/Tools/AP_Periph/AP_Periph.cpp +++ b/Tools/AP_Periph/AP_Periph.cpp @@ -57,15 +57,6 @@ void loop(void) static uint32_t start_ms; -/* - declare constant app_descriptor in flash - */ -#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS -const struct app_descriptor app_descriptor __attribute__((section(".app_descriptor"))); -#else -const struct app_descriptor app_descriptor; -#endif - AP_Periph_FW::AP_Periph_FW() #if HAL_LOGGING_ENABLED : logger(g.log_bitmask) @@ -131,12 +122,7 @@ void AP_Periph_FW::init() logger.Init(log_structure, ARRAY_SIZE(log_structure)); #endif - printf("Booting %08x:%08x %u/%u len=%u 0x%08x\n", - app_descriptor.image_crc1, - app_descriptor.image_crc2, - app_descriptor.version_major, app_descriptor.version_minor, - app_descriptor.image_size, - app_descriptor.git_hash); + check_firmware_print(); if (hal.util->was_watchdog_reset()) { printf("Reboot after watchdog reset\n"); diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 77262b1634..934c5f7e1b 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -14,6 +14,7 @@ #include #include #include "../AP_Bootloader/app_comms.h" +#include #include "hwing_esc.h" #include #include diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index bdd7c5a87d..0a6367cc7b 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -31,7 +31,6 @@ #if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS #include -#include "../AP_Bootloader/app_comms.h" #include #include #include diff --git a/Tools/AP_Periph/wscript b/Tools/AP_Periph/wscript index ecb1a88026..14a44d7bcc 100644 --- a/Tools/AP_Periph/wscript +++ b/Tools/AP_Periph/wscript @@ -62,6 +62,7 @@ def build(bld): 'AC_PID', 'AP_BLHeli', 'AP_ESC_Telem', + 'AP_CheckFirmware', ] bld.ap_stlib( name= 'AP_Periph_libs',