mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
575010169a
The board info blob is stored in the last 128 bytes of the bootloader's flash bank. You can access this data from the application firmware like this: #include <pios_board_info.h> if (pios_board_info_blob.magic == PIOS_BOARD_INFO_BLOB_MAGIC) { /* Check some other fields */ } DO NOT link pios_board_info.c into your application firmware. Only bootloaders should provide the content for the board info structure. The application firmware is only a user of the data.
16 lines
344 B
C
16 lines
344 B
C
#define PIOS_BOARD_INFO_BLOB_MAGIC 0xBDBDBDBD
|
|
|
|
struct pios_board_info {
|
|
uint32_t magic;
|
|
uint8_t board_type;
|
|
uint8_t board_rev;
|
|
uint8_t bl_rev;
|
|
uint8_t hw_type;
|
|
uint32_t fw_base;
|
|
uint32_t fw_size;
|
|
uint32_t desc_base;
|
|
uint32_t desc_size;
|
|
} __attribute__((packed));
|
|
|
|
extern const struct pios_board_info pios_board_info_blob;
|