diff options
author | Maureen Helm <maureen.helm@intel.com> | 2022-10-04 16:06:55 -0500 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2024-10-02 07:49:53 +1000 |
commit | 90c5b04a97846cf63bfb15e48bc1d7cca6557a0c (patch) | |
tree | 9bdee97801f5b8bb453d71257ea81a0b4b03ddeb | |
parent | 2407c46dac4ce75a64bc167478fab45c79c3396b (diff) | |
download | micropython-90c5b04a97846cf63bfb15e48bc1d7cca6557a0c.tar.gz micropython-90c5b04a97846cf63bfb15e48bc1d7cca6557a0c.zip |
zephyr: Replace deprecated FLASH_AREA macros with FIXED_PARTITION.
Zephyr v3.2.0 deprecated FLASH_AREA macros in favor of FIXED_PARTITION
macros, using node labels instead of node label properties to reference
flash storage partitions.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
-rw-r--r-- | ports/zephyr/main.c | 4 | ||||
-rw-r--r-- | ports/zephyr/zephyr_storage.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c index 7a18f48165..9fae2b3a87 100644 --- a/ports/zephyr/main.c +++ b/ports/zephyr/main.c @@ -100,8 +100,8 @@ static void vfs_init(void) { mp_obj_t args[] = { mp_obj_new_str_from_cstr(CONFIG_SDMMC_VOLUME_NAME) }; bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_disk_access_type, make_new)(&zephyr_disk_access_type, ARRAY_SIZE(args), 0, args); mount_point_str = "/sd"; - #elif defined(CONFIG_FLASH_MAP) && FLASH_AREA_LABEL_EXISTS(storage) - mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FLASH_AREA_ID(storage)), MP_OBJ_NEW_SMALL_INT(4096) }; + #elif defined(CONFIG_FLASH_MAP) && FIXED_PARTITION_EXISTS(storage_partition) + mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FIXED_PARTITION_ID(storage_partition)), MP_OBJ_NEW_SMALL_INT(4096) }; bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_flash_area_type, make_new)(&zephyr_flash_area_type, ARRAY_SIZE(args), 0, args); mount_point_str = "/flash"; #endif diff --git a/ports/zephyr/zephyr_storage.c b/ports/zephyr/zephyr_storage.c index af1772205e..484feb1130 100644 --- a/ports/zephyr/zephyr_storage.c +++ b/ports/zephyr/zephyr_storage.c @@ -244,8 +244,8 @@ static const mp_rom_map_elem_t zephyr_flash_area_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&zephyr_flash_area_readblocks_obj) }, { MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&zephyr_flash_area_writeblocks_obj) }, { MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&zephyr_flash_area_ioctl_obj) }, - #if FLASH_AREA_LABEL_EXISTS(storage) - { MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FLASH_AREA_ID(storage)) }, + #if FIXED_PARTITION_EXISTS(storage_partition) + { MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FIXED_PARTITION_ID(storage_partition)) }, #endif }; static MP_DEFINE_CONST_DICT(zephyr_flash_area_locals_dict, zephyr_flash_area_locals_dict_table); |