From 90c5b04a97846cf63bfb15e48bc1d7cca6557a0c Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 4 Oct 2022 16:06:55 -0500 Subject: [PATCH] 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 --- ports/zephyr/main.c | 4 ++-- 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);