diff --git a/src/platforms/px4_micro_hal.h b/src/platforms/px4_micro_hal.h index 3ac265e758..d4a92a7826 100644 --- a/src/platforms/px4_micro_hal.h +++ b/src/platforms/px4_micro_hal.h @@ -47,6 +47,14 @@ __BEGIN_DECLS * schemes or 0,1,2 for zero based schemes. */ +/* PX4_SOC_ARCH_ID is monotonic ordinal number assigned by PX4 to a chip + * architecture. The 2 bytes are used to create a globally unique ID when + * prepended to a padded Soc ID. + */ + +#define PX4_SOC_ARCH_ID_BASE 0x0001 +#define PX4_MK_SOC_ARCH_ID(a) ((a)+PX4_SOC_ARCH_ID_BASE) + #define PX4_BUS_NUMBER_TO_PX4(x) ((x)+PX4_BUS_OFFSET) /* Use to define Zero based to match Nuttx Driver but provide 1 based to PX4 */ #define PX4_BUS_NUMBER_FROM_PX4(x) ((x)-PX4_BUS_OFFSET) /* Use to map PX4 1 based to NuttX driver 0 based */ @@ -57,6 +65,7 @@ __BEGIN_DECLS # if defined(CONFIG_ARCH_CHIP_STM32) # include +# define PX4_SOC_ARCH_ID PX4_MK_SOC_ARCH_ID(0) # define PX4_FLASH_BASE STM32_FLASH_BASE # if defined(CONFIG_STM32_STM32F4XXX) # include @@ -67,6 +76,7 @@ __BEGIN_DECLS # endif # if defined(CONFIG_ARCH_CHIP_STM32F7) +# define PX4_SOC_ARCH_ID PX4_MK_SOC_ARCH_ID(1) # include # include //include up_systemreset() which is included on stm32.h # include @@ -144,6 +154,7 @@ __BEGIN_DECLS #endif // defined(CONFIG_ARCH_CHIP_STM32) || defined(CONFIG_ARCH_CHIP_STM32F7) #if defined(CONFIG_ARCH_CHIP_KINETIS) +# define PX4_SOC_ARCH_ID PX4_MK_SOC_ARCH_ID(2) # // Fixme: using ?? # define PX4_BBSRAM_SIZE 2048 @@ -217,6 +228,8 @@ __BEGIN_DECLS # include # include +# define PX4_SOC_ARCH_ID PX4_MK_SOC_ARCH_ID(3) + # // Fixme: using ?? # define PX4_BBSRAM_SIZE 2048 # define PX4_BBSRAM_GETDESC_IOCTL 0