Skip to content

Commit 442fb57

Browse files
committed
Add 's' to system menu to display the partition table
1 parent 8bc7e1d commit 442fb57

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ void menuSystem()
189189

190190
systemPrintln("r) Reset all settings to default");
191191

192+
systemPrintln("s) Display the partition table");
193+
192194
systemPrintf("z) Set time zone offset: %02d:%02d:%02d\r\n", settings.timeZoneHours, settings.timeZoneMinutes,
193195
settings.timeZoneSeconds);
194196

@@ -260,6 +262,8 @@ void menuSystem()
260262
else
261263
systemPrintln("Reset aborted");
262264
}
265+
else if (incoming == 's')
266+
printPartitionTable();
263267
else if (incoming == 'z')
264268
{
265269
systemPrint("Enter time zone hour offset (-23 <= offset <= 23): ");

Firmware/RTK_Surveyor/support.ino

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,25 @@ void printUbloxInvalidData(PARSE_STATE *parse)
799799
systemPrintf(" %s Invalid UBX data, %d bytes\r\n", parse->parserName, parse->length - 1);
800800
}
801801

802+
void printPartitionTable(void)
803+
{
804+
systemPrintln("ESP32 Partition table:\n");
805+
806+
systemPrintln("| Type | Sub | Offset | Size | Label |");
807+
systemPrintln("| ---- | --- | -------- | -------- | ---------------- |");
808+
809+
esp_partition_iterator_t pi = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
810+
if (pi != NULL)
811+
{
812+
do
813+
{
814+
const esp_partition_t *p = esp_partition_get(pi);
815+
systemPrintf("| %02x | %02x | 0x%06X | 0x%06X | %-16s |\r\n", p->type, p->subtype, p->address, p->size,
816+
p->label);
817+
} while ((pi = (esp_partition_next(pi))));
818+
}
819+
}
820+
802821
// Verify table sizes match enum definitions
803822
void verifyTables()
804823
{

0 commit comments

Comments
 (0)