From 092c20b3a7a3244c362fd43c24e39847860a3425 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 28 Oct 2019 10:46:42 +1100 Subject: [PATCH] AP_Periph: use flash app_descriptor --- Tools/AP_Periph/AP_Periph.cpp | 12 +----------- Tools/AP_Periph/AP_Periph.h | 1 + Tools/AP_Periph/version.h | 6 ------ 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Tools/AP_Periph/AP_Periph.cpp b/Tools/AP_Periph/AP_Periph.cpp index 07f4aedf8c..2af3d9d2be 100644 --- a/Tools/AP_Periph/AP_Periph.cpp +++ b/Tools/AP_Periph/AP_Periph.cpp @@ -51,17 +51,7 @@ static uint32_t start_ms; /* declare constant app_descriptor in flash */ -const struct app_descriptor app_descriptor __attribute__((section(".app_descriptor"))) = { - .sig = { 0x40, 0xa2, 0xe4, 0xf1, 0x64, 0x68, 0x91, 0x06 }, - .image_crc1 = 0, - .image_crc2 = 0, - .image_size = 0, - .git_hash = 0, - .version_major = AP::fwversion().major, - .version_minor = AP::fwversion().minor, - .board_id = APJ_BOARD_ID, - .reserved = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } -}; +const struct app_descriptor app_descriptor __attribute__((section(".app_descriptor"))); void AP_Periph_FW::init() { diff --git a/Tools/AP_Periph/AP_Periph.h b/Tools/AP_Periph/AP_Periph.h index 7518f709b9..f7b8ab2c78 100644 --- a/Tools/AP_Periph/AP_Periph.h +++ b/Tools/AP_Periph/AP_Periph.h @@ -6,6 +6,7 @@ #include #include #include +#include "version.h" #include "../AP_Bootloader/app_comms.h" #if defined(HAL_PERIPH_NEOPIXEL_COUNT) || defined(HAL_PERIPH_ENABLE_NCP5623_LED) diff --git a/Tools/AP_Periph/version.h b/Tools/AP_Periph/version.h index 2f4cbe03a8..afa4d258b7 100644 --- a/Tools/AP_Periph/version.h +++ b/Tools/AP_Periph/version.h @@ -1,11 +1,5 @@ #pragma once -#ifndef FORCE_VERSION_H_INCLUDE -#error version.h should never be included directly. You probably want to include AP_Common/AP_FWVersion.h -#endif - -#include "ap_version.h" - #define THISFIRMWARE "AP_Periph V1.0dev" // the following line is parsed by the autotest scripts