Fri3dCamp / badge_2024_micropython

Fri3d Badge Firmware
https://www.fri3d.be
Other
3 stars 5 forks source link

get_next_update: ignore OTA partitions above OTA_1 #12

Closed tomvanbraeckel closed 4 months ago

tomvanbraeckel commented 4 months ago

The Fri3D Camp badge only uses and updates OTA_0 and OTA_1, for MicroPython.

Yet higher ones might be present for use by additional apps, such as the retro-go emulator.

Therefore, these should be ignored when get_next_update() determines which partition should receive the next update.

Example:

from esp32 import Partition
Partition(Partition.RUNNING) # if this shows ota_1 then this:
Partition(Partition.RUNNING).get_next_update() # will return ota_0 instead of ota_2

This minimal patch has a debug printf() that is disabled by default to avoid changing the output of get_next_update().

MathyV commented 4 months ago

No longer applicable