From 89c287581b3e1607a4e9ebbc3cc6fcf740e71c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Mi=C5=A1i=C4=87?= Date: Mon, 20 Jun 2022 14:06:45 +0200 Subject: [PATCH] boards/px4/fmu-v6c: update to extended hw_ver_rev format --- boards/px4/fmu-v6c/src/board_config.h | 4 +--- boards/px4/fmu-v6c/src/manifest.c | 4 ++-- boards/px4/fmu-v6c/src/mtd.cpp | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/px4/fmu-v6c/src/board_config.h b/boards/px4/fmu-v6c/src/board_config.h index d92fa394a0..4f81375289 100644 --- a/boards/px4/fmu-v6c/src/board_config.h +++ b/boards/px4/fmu-v6c/src/board_config.h @@ -139,9 +139,7 @@ #define GPIO_HW_VER_REV_DRIVE /* PE12 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN12) #define GPIO_HW_REV_SENSE /* PC0 */ GPIO_ADC123_INP10 #define GPIO_HW_VER_SENSE /* PC1 */ GPIO_ADC123_INP11 -#define HW_INFO_INIT {'V','6','C','x', 'x',0} -#define HW_INFO_INIT_VER 3 /* Offset in above string of the VER */ -#define HW_INFO_INIT_REV 4 /* Offset in above string of the REV */ +#define HW_INFO_INIT_PREFIX "V6C" #define BOARD_NUM_SPI_CFG_HW_VERSIONS 2 // Rev 0, 10 Sensor sets // Base/FMUM diff --git a/boards/px4/fmu-v6c/src/manifest.c b/boards/px4/fmu-v6c/src/manifest.c index 04d2386163..90b1358e65 100644 --- a/boards/px4/fmu-v6c/src/manifest.c +++ b/boards/px4/fmu-v6c/src/manifest.c @@ -121,7 +121,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) static px4_hw_mft_list_entry boards_manifest = px4_hw_mft_list_uninitialized; if (boards_manifest == px4_hw_mft_list_uninitialized) { - uint32_t ver_rev = board_get_hw_version() << 8; + uint32_t ver_rev = board_get_hw_version() << 16; ver_rev |= board_get_hw_revision(); for (unsigned i = 0; i < arraySize(mft_lists); i++) { @@ -132,7 +132,7 @@ __EXPORT px4_hw_mft_item board_query_manifest(px4_hw_mft_item_id_t id) } if (boards_manifest == px4_hw_mft_list_uninitialized) { - syslog(LOG_ERR, "[boot] Board %4" PRIx32 " is not supported!\n", ver_rev); + syslog(LOG_ERR, "[boot] Board %08" PRIx32 " is not supported!\n", ver_rev); } } diff --git a/boards/px4/fmu-v6c/src/mtd.cpp b/boards/px4/fmu-v6c/src/mtd.cpp index 530c7a3bef..a56daa90c7 100644 --- a/boards/px4/fmu-v6c/src/mtd.cpp +++ b/boards/px4/fmu-v6c/src/mtd.cpp @@ -95,7 +95,9 @@ static const px4_mft_entry_s mtd_mft = { static const px4_mft_s mft = { .nmft = 1, - .mfts = &mtd_mft + .mfts = { + &mtd_mft + } }; const px4_mft_s *board_get_manifest(void)