mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +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.
17 lines
518 B
C
17 lines
518 B
C
#include <pios.h>
|
|
#include <pios_board.h>
|
|
|
|
#include "pios_board_info.h"
|
|
|
|
const struct pios_board_info __attribute__((__used__)) __attribute__((__section__(".boardinfo"))) pios_board_info_blob = {
|
|
.magic = PIOS_BOARD_INFO_BLOB_MAGIC,
|
|
.board_type = BOARD_TYPE,
|
|
.board_rev = BOARD_REVISION,
|
|
.bl_rev = BOOTLOADER_VERSION,
|
|
.hw_type = HW_TYPE,
|
|
.fw_base = START_OF_USER_CODE,
|
|
.fw_size = SIZE_OF_CODE,
|
|
.desc_base = START_OF_USER_CODE + SIZE_OF_CODE,
|
|
.desc_size = SIZE_OF_DESCRIPTION,
|
|
};
|