|
26 | 26 | #include <zephyr/fs/nvs.h> |
27 | 27 | #include "nvs_priv.h" |
28 | 28 |
|
29 | | -#define TEST_FLASH_AREA_STORAGE_OFFSET FLASH_AREA_OFFSET(storage) |
| 29 | +#define TEST_NVS_FLASH_AREA storage |
| 30 | +#define TEST_NVS_FLASH_OFFSET FLASH_AREA_OFFSET(TEST_NVS_FLASH_AREA) |
| 31 | +#define TEST_NVS_FLASH_DEV_NODE \ |
| 32 | + DT_MTD_FROM_FIXED_PARTITION(DT_NODE_BY_FIXED_PARTITION_LABEL(TEST_NVS_FLASH_AREA)) |
30 | 33 | #define TEST_DATA_ID 1 |
31 | 34 | #define TEST_SECTOR_COUNT 5U |
32 | 35 |
|
33 | | -static const struct device *flash_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); |
| 36 | +static const struct device *flash_dev = DEVICE_DT_GET(TEST_NVS_FLASH_DEV_NODE); |
34 | 37 | static struct nvs_fs fs; |
35 | 38 | struct stats_hdr *sim_stats; |
36 | 39 | struct stats_hdr *sim_thresholds; |
@@ -65,10 +68,10 @@ void test_nvs_mount(void) |
65 | 68 | const struct flash_area *fa; |
66 | 69 | struct flash_pages_info info; |
67 | 70 |
|
68 | | - err = flash_area_open(FLASH_AREA_ID(storage), &fa); |
| 71 | + err = flash_area_open(FLASH_AREA_ID(TEST_NVS_FLASH_AREA), &fa); |
69 | 72 | zassert_true(err == 0, "flash_area_open() fail: %d", err); |
70 | 73 |
|
71 | | - fs.offset = TEST_FLASH_AREA_STORAGE_OFFSET; |
| 74 | + fs.offset = TEST_NVS_FLASH_OFFSET; |
72 | 75 | err = flash_get_page_info_by_offs(flash_area_get_device(fa), fs.offset, |
73 | 76 | &info); |
74 | 77 | zassert_true(err == 0, "Unable to get page info: %d", err); |
|
0 commit comments