px4_manifest: fix px4_mft_s to accept multiple manifests

This commit is contained in:
Igor Mišić 2021-12-15 23:35:50 +01:00 committed by Beat Küng
parent 432b664acc
commit 3463b725a5
9 changed files with 28 additions and 13 deletions

View File

@ -72,7 +72,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -71,7 +71,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -66,7 +66,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -65,7 +65,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -105,7 +105,6 @@ static const px4_mtd_manifest_t board_mtd_config = {
.nconfigs = 3,
.entries = {
&fmum_fram,
&base_eeprom,
&imu_eeprom
}
};
@ -117,7 +116,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -71,7 +71,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -117,7 +117,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
const px4_mft_s *board_get_manifest(void)

View File

@ -65,7 +65,7 @@ typedef struct {
typedef struct {
const uint32_t nmft;
const px4_mft_entry_s *mfts;
const px4_mft_entry_s *mfts[];
} px4_mft_s;
#include "px4_platform_common/mtd_manifest.h"

View File

@ -58,7 +58,9 @@ static const px4_mft_entry_s mtd_mft = {
static const px4_mft_s default_mft = {
.nmft = 1,
.mfts = &mtd_mft
.mfts = {
&mtd_mft
}
};
@ -73,9 +75,9 @@ __EXPORT int px4_mft_configure(const px4_mft_s *mft)
if (mft != nullptr) {
for (uint32_t m = 0; m < mft->nmft; m++) {
switch (mft->mfts[m].type) {
switch (mft->mfts[m]->type) {
case MTD:
px4_mtd_config(static_cast<const px4_mtd_manifest_t *>(mft->mfts[m].pmft));
px4_mtd_config(static_cast<const px4_mtd_manifest_t *>(mft->mfts[m]->pmft));
break;
case MFT:
@ -95,7 +97,7 @@ __EXPORT int px4_mft_query(const px4_mft_s *mft, px4_manifest_types_e type,
if (mft != nullptr) {
for (uint32_t m = 0; m < mft->nmft; m++) {
if (mft->mfts[m].type == type)
if (mft->mfts[m]->type == type)
switch (type) {
case MTD:
return px4_mtd_query(sub, val);