Skip to content

Commit 478e21a

Browse files
committed
zephyr: Replace old macro FLASH_AREA_* with FIXED_PARTITION_*
`FLASH_AREA_LABEL_EXISTS` and `FLASH_AREA_ID` are marked deprecated in Zephyr 3.2 and are removed in Zephyr 3.6. Here update the macro with the replacement syntax mentioned in the Zephyr 3.2 release note. Reference: - https://docs.zephyrproject.org/latest/releases/release-notes-3.2.html - https://docs.zephyrproject.org/latest/releases/release-notes-3.6.html Signed-off-by: Chun-Yu Lee (Mat) <[email protected]>
1 parent 1e6bd1e commit 478e21a

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
@@ -106,8 +106,8 @@ static void vfs_init(void) {
106106
mp_obj_t args[] = { mp_obj_new_str(CONFIG_SDMMC_VOLUME_NAME, strlen(CONFIG_SDMMC_VOLUME_NAME)) };
107107
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_disk_access_type, make_new)(&zephyr_disk_access_type, ARRAY_SIZE(args), 0, args);
108108
mount_point_str = "/sd";
109-
#elif defined(CONFIG_FLASH_MAP) && FLASH_AREA_LABEL_EXISTS(storage)
110-
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FLASH_AREA_ID(storage)), MP_OBJ_NEW_SMALL_INT(4096) };
109+
#elif defined(CONFIG_FLASH_MAP) && FIXED_PARTITION_EXISTS(storage)
110+
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FIXED_PARTITION_ID(storage)), MP_OBJ_NEW_SMALL_INT(4096) };
111111
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_flash_area_type, make_new)(&zephyr_flash_area_type, ARRAY_SIZE(args), 0, args);
112112
mount_point_str = "/flash";
113113
#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)
248+
{ MP_ROM_QSTR(MP_QSTR_STORAGE), MP_ROM_INT(FIXED_PARTITION_ID(storage)) },
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)