summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ports/zephyr/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c
index 9fae2b3a87..206b7f92d3 100644
--- a/ports/zephyr/main.c
+++ b/ports/zephyr/main.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <zephyr/kernel.h>
+#include <zephyr/version.h>
#ifdef CONFIG_NETWORKING
#include <zephyr/net/net_context.h>
#endif
@@ -97,7 +98,11 @@ static void vfs_init(void) {
int ret = 0;
#ifdef CONFIG_DISK_DRIVER_SDMMC
+ #if KERNEL_VERSION_NUMBER >= ZEPHYR_VERSION(4, 0, 0)
+ mp_obj_t args[] = { mp_obj_new_str_from_cstr(DT_PROP(DT_INST(0, zephyr_sdmmc_disk), disk_name)) };
+ #else
mp_obj_t args[] = { mp_obj_new_str_from_cstr(CONFIG_SDMMC_VOLUME_NAME) };
+ #endif
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) && FIXED_PARTITION_EXISTS(storage_partition)