mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
Partitions are now accessed by types rather than indices
This commit is contained in:
parent
92999681e3
commit
f5084a59bd
8 changed files with 117 additions and 67 deletions
|
@ -2219,8 +2219,20 @@ static void cliFlashInfo(char *cmdline)
|
|||
|
||||
cliPrintLinef("Flash sectors=%u, sectorSize=%u, pagesPerSector=%u, pageSize=%u, totalSize=%u",
|
||||
layout->sectors, layout->sectorSize, layout->pagesPerSector, layout->pageSize, layout->totalSize);
|
||||
|
||||
for (uint8_t index = 0; index < FLASH_MAX_PARTITIONS; index++) {
|
||||
const flashPartition_t *partition;
|
||||
if (index == 0) {
|
||||
cliPrintLine("Paritions:");
|
||||
}
|
||||
partition = flashPartitionFindByIndex(index);
|
||||
if (!partition) {
|
||||
break;
|
||||
}
|
||||
cliPrintLinef(" %d: %s %u %u", index, flashPartitionGetTypeName(partition->type), partition->startSector, partition->endSector);
|
||||
}
|
||||
#ifdef USE_FLASHFS
|
||||
const flashPartition_t *flashPartition = flashFindPartitionByUsage(FLASH_PARTITION_FLASHFS);
|
||||
const flashPartition_t *flashPartition = flashPartitionFindByType(FLASH_PARTITION_TYPE_FLASHFS);
|
||||
|
||||
cliPrintLinef("FlashFS size=%u, usedSize=%u",
|
||||
FLASH_PARTITION_SECTOR_COUNT(flashPartition) * layout->sectorSize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue