forked from Archive/PX4-Autopilot
fmu-v5x: use mtd to get hw info from base EEPROM
This commit is contained in:
parent
cc63c49a51
commit
dd38ced7c4
|
@ -72,6 +72,7 @@ extern "C" {
|
|||
#include <systemlib/px4_macros.h>
|
||||
#include <px4_arch/io_timer.h>
|
||||
#include <px4_platform_common/init.h>
|
||||
#include <px4_platform_common/px4_manifest.h>
|
||||
#include <px4_platform/gpio.h>
|
||||
#include <px4_platform/board_determine_hw_info.h>
|
||||
#include <px4_platform/board_dma_alloc.h>
|
||||
|
@ -221,6 +222,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||
|
||||
px4_platform_init();
|
||||
|
||||
/* Enable base EEPROM MTD to read hardware information*/
|
||||
px4_mtd_config(board_get_base_eeprom_mtd_manifest());
|
||||
|
||||
if (OK == board_determine_hw_info()) {
|
||||
syslog(LOG_INFO, "[boot] Rev 0x%1x : Ver 0x%1x %s\n", board_get_hw_revision(), board_get_hw_version(),
|
||||
|
|
|
@ -102,13 +102,20 @@ static const px4_mtd_entry_t imu_eeprom = {
|
|||
};
|
||||
|
||||
static const px4_mtd_manifest_t board_mtd_config = {
|
||||
.nconfigs = 3,
|
||||
.nconfigs = 2,
|
||||
.entries = {
|
||||
&fmum_fram,
|
||||
&imu_eeprom
|
||||
}
|
||||
};
|
||||
|
||||
static const px4_mtd_manifest_t board_mtd_base_eeprom_config = {
|
||||
.nconfigs = 1,
|
||||
.entries = {
|
||||
&base_eeprom
|
||||
}
|
||||
};
|
||||
|
||||
static const px4_mft_entry_s mtd_mft = {
|
||||
.type = MTD,
|
||||
.pmft = (void *) &board_mtd_config,
|
||||
|
@ -125,3 +132,8 @@ const px4_mft_s *board_get_manifest(void)
|
|||
{
|
||||
return &mft;
|
||||
}
|
||||
|
||||
const px4_mtd_manifest_t *board_get_base_eeprom_mtd_manifest(void)
|
||||
{
|
||||
return &board_mtd_base_eeprom_config;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue