summaryrefslogtreecommitdiff
path: root/ports/zephyr/main.c
diff options
context:
space:
mode:
authorJon Foster <jon@jon-foster.co.uk>2024-04-01 19:23:49 +0100
committerDamien George <damien@micropython.org>2024-07-04 15:55:03 +1000
commit92484d8822635c125a7648d5b056ff7f78d62ab3 (patch)
tree34f8731d56f4330fe0e8a0ca325cdedd8e2eaa8a /ports/zephyr/main.c
parent289b2dd87960a4cdf019013cecd489f0d0cabc26 (diff)
all: Use new mp_obj_new_str_from_cstr() function.
Use new function mp_obj_new_str_from_cstr() where appropriate. It simplifies the code, and makes it smaller too. Signed-off-by: Jon Foster <jon@jon-foster.co.uk>
Diffstat (limited to 'ports/zephyr/main.c')
-rw-r--r--ports/zephyr/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/zephyr/main.c b/ports/zephyr/main.c
index 314bbfd26..2ae5fd222 100644
--- a/ports/zephyr/main.c
+++ b/ports/zephyr/main.c
@@ -103,7 +103,7 @@ static void vfs_init(void) {
int ret = 0;
#ifdef CONFIG_DISK_DRIVER_SDMMC
- mp_obj_t args[] = { mp_obj_new_str(CONFIG_SDMMC_VOLUME_NAME, strlen(CONFIG_SDMMC_VOLUME_NAME)) };
+ 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)
@@ -113,7 +113,7 @@ static void vfs_init(void) {
#endif
if ((bdev != NULL)) {
- mount_point = mp_obj_new_str(mount_point_str, strlen(mount_point_str));
+ mount_point = mp_obj_new_str_from_cstr(mount_point_str);
ret = mp_vfs_mount_and_chdir_protected(bdev, mount_point);
// TODO: if this failed, make a new file system and try to mount again
}