summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDetlev Zundel <dzu@member.fsf.org>2025-02-06 16:40:14 +0100
committerDamien George <damien@micropython.org>2025-04-29 23:00:37 +1000
commitb83606fe337614543f18f0ddf4a3250974b93d3c (patch)
tree04939bbaaf757ebdbb5a46118204116b4a640a51
parentcd3eaad05cf94cd86e9762c854c68a4d4b5c2fab (diff)
downloadmicropython-b83606fe337614543f18f0ddf4a3250974b93d3c.tar.gz
micropython-b83606fe337614543f18f0ddf4a3250974b93d3c.zip
zephyr: Remove reference to CONFIG_MMC_VOLUME_NAME for v4.0.
Commit 07a8e3253a2d8a2076c9c83c4ed4158fa3fbb2a2 removes CONFIG_MMC_VOLUME_NAME from the Kconfig space. Instead we need to use the device tree to find the "disk-name" property of "zephyr,mmc-disk" devices. Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
-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)