mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 20:17:36 +08:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user