feat(mtd): allow bulk erase

This commit is contained in:
alexcekay
2026-06-15 17:48:15 +02:00
committed by Alexander Lerach
parent 6f1f7035a5
commit 246484e91b
4 changed files with 36 additions and 15 deletions

View File

@@ -31,6 +31,7 @@
*
****************************************************************************/
#pragma once
#include <stdbool.h>
#include <stdint.h>
typedef enum {
@@ -55,6 +56,7 @@ typedef struct {
typedef struct {
const px4_mft_device_t *device;
const uint32_t npart;
const bool bulk_erase;
const px4_mtd_part_t partd[];
} px4_mtd_entry_t;

View File

@@ -31,6 +31,7 @@
*
****************************************************************************/
#pragma once
#include <stdbool.h>
#include <stdint.h>
__BEGIN_DECLS
@@ -48,6 +49,7 @@ typedef struct {
struct mtd_dev_s **part_dev;
uint32_t devid;
unsigned n_partitions_current;
bool bulk_erase;
} mtd_instance_s;
/*

View File

@@ -346,6 +346,7 @@ memoryout:
uint32_t nparts = mtd_list->entries[num_entry]->npart;
instances[i]->devid = mtd_list->entries[num_entry]->device->devid;
instances[i]->bulk_erase = mtd_list->entries[num_entry]->bulk_erase;
instances[i]->mtd_dev = nullptr;
instances[i]->n_partitions_current = 0;