Skip to content

Commit 90c5b04

Browse files
MaureenHelmdpgeorge
authored andcommitted
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 <[email protected]>
1 parent 2407c46 commit 90c5b04

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ports/zephyr/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ static void vfs_init(void) {
100100
mp_obj_t args[] = { mp_obj_new_str_from_cstr(CONFIG_SDMMC_VOLUME_NAME) };
101101
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_disk_access_type, make_new)(&zephyr_disk_access_type, ARRAY_SIZE(args), 0, args);
102102
mount_point_str = "/sd";
103-
#elif defined(CONFIG_FLASH_MAP) && FLASH_AREA_LABEL_EXISTS(storage)
104-
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FLASH_AREA_ID(storage)), MP_OBJ_NEW_SMALL_INT(4096) };
103+
#elif defined(CONFIG_FLASH_MAP) && FIXED_PARTITION_EXISTS(storage_partition)
104+
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FIXED_PARTITION_ID(storage_partition)), MP_OBJ_NEW_SMALL_INT(4096) };
105105
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_flash_area_type, make_new)(&zephyr_flash_area_type, ARRAY_SIZE(args), 0, args);
106106
mount_point_str = "/flash";
107107
#endif

ports/zephyr/zephyr_storage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ static const mp_rom_map_elem_t zephyr_flash_area_locals_dict_table[] = {
244244
{ MP_ROM_QSTR(MP_QSTR_readblocks), MP_ROM_PTR(&zephyr_flash_area_readblocks_obj) },
245245
{ MP_ROM_QSTR(MP_QSTR_writeblocks), MP_ROM_PTR(&zephyr_flash_area_writeblocks_obj) },
246246
{ MP_ROM_QSTR(MP_QSTR_ioctl), MP_ROM_PTR(&zephyr_flash_area_ioctl_obj) },
247-
#if FLASH_AREA_LABEL_EXISTS(storage)
248-
{ MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FLASH_AREA_ID(storage)) },
247+
#if FIXED_PARTITION_EXISTS(storage_partition)
248+
{ MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FIXED_PARTITION_ID(storage_partition)) },
249249
#endif
250250
};
251251
static MP_DEFINE_CONST_DICT(zephyr_flash_area_locals_dict, zephyr_flash_area_locals_dict_table);

0 commit comments

Comments
 (0)