px4_manifest: fix px4_mft_s to accept multiple manifests

This commit is contained in:
Igor Mišić
2022-07-05 09:29:26 +02:00
committed by Beat Küng
parent 432b664acc
commit 3463b725a5
9 changed files with 28 additions and 13 deletions
@@ -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);