Skip to content

Commit

Permalink
zephyr: Replace deprecated FLASH_AREA macros with FIXED_PARTITION.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MaureenHelm authored and dpgeorge committed Oct 1, 2024
1 parent 2407c46 commit 90c5b04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ports/zephyr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ports/zephyr/zephyr_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 90c5b04

Please sign in to comment.