mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 23:51:36 +08:00
common board idenity cleanup and add mfguid to api
Remove the notion of legacy from the api. The board level code will perform the traslation to lecacy format on the STM32. new targets will not need to do this as there is no case where the serial number were used by mfg for tracking. Extend board common api to get mfguid and mfguid formatted This adds an api that return the MFGUID as an array of bytes or a string. The data is returned with the MSD at index 0 and the LSD at index PX4_CPU_MFGUID_BYTE_LENGTH-1. Removed all reodering defines from the api and hal
This commit is contained in:
committed by
Lorenz Meier
parent
b182a5eeca
commit
bc8b117e85
@@ -10,18 +10,24 @@
|
||||
#define PX4_I2C_OBDEV_LED 0x55
|
||||
|
||||
#define BOARD_OVERRIDE_UUID "SIMULATIONID"
|
||||
#define BOARD_OVERRIDE_MFGUID BOARD_OVERRIDE_UUID
|
||||
#define SIM_FORMATED_UUID "000000010000000200000003"
|
||||
#define PX4_CPU_UUID_BYTE_LENGTH 12
|
||||
#define PX4_CPU_UUID_WORD32_LENGTH 3
|
||||
#define PX4_CPU_UUID_WORD32_LEGACY_FORMAT_SIZE (PX4_CPU_UUID_WORD32_LENGTH-1+(2*PX4_CPU_UUID_BYTE_LENGTH))
|
||||
#define PX4_CPU_MFGUID_BYTE_LENGTH PX4_CPU_UUID_BYTE_LENGTH
|
||||
#define PX4_CPU_UUID_WORD32_UNIQUE_H 2 /* Most significant digits change the least */
|
||||
#define PX4_CPU_UUID_WORD32_UNIQUE_M 1 /* Middle significant digits */
|
||||
#define PX4_CPU_UUID_WORD32_UNIQUE_L 0 /* Least significant digits change the most */
|
||||
#define PX4_CPU_UUID_WORD32_FORMAT_SIZE (PX4_CPU_UUID_WORD32_LENGTH-1+(2*PX4_CPU_UUID_BYTE_LENGTH)+1)
|
||||
#define PX4_CPU_MFGUID_FORMAT_SIZE ((2*PX4_CPU_MFGUID_BYTE_LENGTH)+1)
|
||||
|
||||
#define BOARD_OVERRIDE_CPU_VERSION (-1)
|
||||
#define board_mcu_version(rev, revstr, errata) BOARD_OVERRIDE_CPU_VERSION
|
||||
typedef unsigned char raw_uuid_byte_t[PX4_CPU_UUID_BYTE_LENGTH];
|
||||
typedef unsigned int raw_uuid_uint32_t[PX4_CPU_UUID_WORD32_LENGTH];
|
||||
typedef unsigned char uuid_byte_t[PX4_CPU_UUID_BYTE_LENGTH];
|
||||
typedef unsigned int uuid_uint32_t[PX4_CPU_UUID_WORD32_LENGTH];
|
||||
|
||||
#define board_get_uuid_raw32(id, null) do {id[0]=0;id[1]=1;id[2]=2;} while(0)
|
||||
#define board_get_uuid_formated32(format_buffer, size, format, seperator, optional_reorder) do { strcpy(format_buffer, SIM_FORMATED_UUID); } while(0)
|
||||
#define board_get_uuid32(id) do {for(int _idi=0; _idi < PX4_CPU_UUID_WORD32_LENGTH; _idi++) {id[_idi] = _idi;}} while(0)
|
||||
#define board_get_uuid32_formated(format_buffer, size, format, seperator) do { strcpy(format_buffer, SIM_FORMATED_UUID); } while(0)
|
||||
|
||||
|
||||
#define CONFIG_NFILE_STREAMS 1
|
||||
|
||||
Reference in New Issue
Block a user