mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 18:56:58 +08:00
fmu-v5x: use mtd to get hw info from base EEPROM
This commit is contained in:
@@ -72,6 +72,7 @@ extern "C" {
|
|||||||
#include <systemlib/px4_macros.h>
|
#include <systemlib/px4_macros.h>
|
||||||
#include <px4_arch/io_timer.h>
|
#include <px4_arch/io_timer.h>
|
||||||
#include <px4_platform_common/init.h>
|
#include <px4_platform_common/init.h>
|
||||||
|
#include <px4_platform_common/px4_manifest.h>
|
||||||
#include <px4_platform/gpio.h>
|
#include <px4_platform/gpio.h>
|
||||||
#include <px4_platform/board_determine_hw_info.h>
|
#include <px4_platform/board_determine_hw_info.h>
|
||||||
#include <px4_platform/board_dma_alloc.h>
|
#include <px4_platform/board_dma_alloc.h>
|
||||||
@@ -221,6 +222,8 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
|
|
||||||
px4_platform_init();
|
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()) {
|
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(),
|
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 = {
|
static const px4_mtd_manifest_t board_mtd_config = {
|
||||||
.nconfigs = 3,
|
.nconfigs = 2,
|
||||||
.entries = {
|
.entries = {
|
||||||
&fmum_fram,
|
&fmum_fram,
|
||||||
&imu_eeprom
|
&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 = {
|
static const px4_mft_entry_s mtd_mft = {
|
||||||
.type = MTD,
|
.type = MTD,
|
||||||
.pmft = (void *) &board_mtd_config,
|
.pmft = (void *) &board_mtd_config,
|
||||||
@@ -125,3 +132,8 @@ const px4_mft_s *board_get_manifest(void)
|
|||||||
{
|
{
|
||||||
return &mft;
|
return &mft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const px4_mtd_manifest_t *board_get_base_eeprom_mtd_manifest(void)
|
||||||
|
{
|
||||||
|
return &board_mtd_base_eeprom_config;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user