Merge PR #19575 (changes to pr-extendend_hw_ver_rev_format)

- 4096 of 3 hex digits each for rev and ver is enough.
    #defines used in SPI versions do not be long format, use use the macro
 - Board provides a prefix and the formatting is sized and built in
 - No need for funky board_get_base_eeprom_mtd_manifest interface
    Original mft is used where the abstraction is done with the MFT interface

Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
This commit is contained in:
Igor Mišić
2022-07-04 12:15:46 +02:00
committed by Beat Küng
parent f7d542e720
commit 4b503c310e
44 changed files with 199 additions and 188 deletions
+3 -2
View File
@@ -46,6 +46,7 @@
#include <stdbool.h>
#include <string.h>
#include <version/version.h>
#include <version/version.h>
/* string constants for version commands */
static const char sz_ver_hw_str[] = "hw";
@@ -141,11 +142,11 @@ extern "C" __EXPORT int ver_main(int argc, char *argv[])
int r = px4_board_hw_revision();
if (v >= 0) {
snprintf(vb, sizeof(vb), "0x%08X", v);
snprintf(vb, sizeof(vb), "0x%0" STRINGIFY(HW_INFO_VER_DIGITS) "X", v);
}
if (r >= 0) {
snprintf(rb, sizeof(rb), "0x%08X", r);
snprintf(rb, sizeof(rb), "0x%0" STRINGIFY(HW_INFO_REV_DIGITS) "X", r);
}
printf("HW type: %s\n", strlen(px4_board_sub_type()) ? px4_board_sub_type() : "NA");