From 106a83de222a7c9ceb3f70ca214677c996916489 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 7 Feb 2022 21:05:48 +1100 Subject: esp32/esp32_partition: Add support for specifying block_size. To support filesystems that use a block size different from the native erase-page size. Signed-off-by: Damien George --- docs/library/esp32.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs/library/esp32.rst') diff --git a/docs/library/esp32.rst b/docs/library/esp32.rst index ff1c99a553..82e69e4964 100644 --- a/docs/library/esp32.rst +++ b/docs/library/esp32.rst @@ -68,17 +68,21 @@ Flash partitions This class gives access to the partitions in the device's flash memory and includes methods to enable over-the-air (OTA) updates. -.. class:: Partition(id) +.. class:: Partition(id, block_size=4096) Create an object representing a partition. *id* can be a string which is the label of the partition to retrieve, or one of the constants: ``BOOT`` or ``RUNNING``. + *block_size* specifies the byte size of an individual block. -.. classmethod:: Partition.find(type=TYPE_APP, subtype=0xff, label=None) +.. classmethod:: Partition.find(type=TYPE_APP, subtype=0xff, label=None, block_size=4096) Find a partition specified by *type*, *subtype* and *label*. Returns a (possibly empty) list of Partition objects. Note: ``subtype=0xff`` matches any subtype and ``label=None`` matches any label. + *block_size* specifies the byte size of an individual block used by the returned + objects. + .. method:: Partition.info() Returns a 6-tuple ``(type, subtype, addr, size, label, encrypted)``. -- cgit v1.2.3