forked from ArduPilot/ardupilot
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AP_CheckFirmware: add separate AP_CheckFirmwareDefine for correctly s…
…etting firmware versions
- Loading branch information
1 parent
db84c27
commit 065eb53
Showing
3 changed files
with
64 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef FORCE_VERSION_H_INCLUDE | ||
#error AP_CheckFirmwareDefines.h should never be included directly. You probably want to include AP_Common/AP_FWVersion.h | ||
#endif | ||
#include "AP_CheckFirmware.h" | ||
|
||
#if AP_CHECK_FIRMWARE_ENABLED | ||
/* | ||
declare constant app_descriptor in flash | ||
*/ | ||
#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS | ||
extern const app_descriptor_t app_descriptor; | ||
const app_descriptor_t app_descriptor __attribute__((section(".app_descriptor"))) = { | ||
.sig = AP_APP_DESCRIPTOR_SIGNATURE_UNSIGNED, | ||
.image_crc1 = 0, | ||
.image_crc2 = 0, | ||
.image_size = 0, | ||
.git_hash = 0, | ||
#if AP_SIGNED_FIRMWARE | ||
.signature_length = 0, | ||
.signature = {}, | ||
#endif | ||
.version_major = APP_FW_MAJOR, | ||
.version_minor = APP_FW_MINOR, | ||
.board_id = APJ_BOARD_ID, | ||
.reserved = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } | ||
}; | ||
#else | ||
const app_descriptor_t app_descriptor = { | ||
.sig = AP_APP_DESCRIPTOR_SIGNATURE_UNSIGNED, | ||
.image_crc1 = 0, | ||
.image_crc2 = 0, | ||
.image_size = 0, | ||
.git_hash = 0, | ||
#if AP_SIGNED_FIRMWARE | ||
.signature_length = 0, | ||
.signature = {}, | ||
#endif | ||
.version_major = APP_FW_MAJOR, | ||
.version_minor = APP_FW_MINOR, | ||
.board_id = APJ_BOARD_ID, | ||
.reserved = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } | ||
}; | ||
#endif | ||
#endif |