From cbd711715914df94bef9a4983227098c731af305 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 12 Nov 2024 12:20:22 +0100 Subject: [PATCH] misc: Remove filesystem initialization functions. Signed-off-by: iabdalkader --- src/omv/common/mp_utils.c | 38 -------------------------------------- src/omv/common/mp_utils.h | 1 - 2 files changed, 39 deletions(-) diff --git a/src/omv/common/mp_utils.c b/src/omv/common/mp_utils.c index a9b3657ab..dd584c254 100644 --- a/src/omv/common/mp_utils.c +++ b/src/omv/common/mp_utils.c @@ -34,19 +34,11 @@ #include "shared/runtime/gchelper.h" #include "shared/runtime/softtimer.h" #include "shared/runtime/pyexec.h" -#if MICROPY_HW_USB_MSC -#include "extmod/vfs.h" -#include "extmod/vfs_fat.h" -// Fresh filesystem templates. -#include "main_py.h" -#include "readme_txt.h" -#endif #include "omv_boardconfig.h" #include "usbdbg.h" #if OMV_WIFIDBG_ENABLE #include "wifidbg.h" #endif -#include "file_utils.h" #include "mp_utils.h" void __attribute__((weak)) gc_collect(void) { @@ -70,36 +62,6 @@ void __attribute__((weak)) gc_collect(void) { gc_collect_end(); } -#if MICROPY_VFS_FAT -extern void __fatal_error(); - -int mp_init_filesystem(fs_user_mount_t *vfs) { - FIL fp; UINT n; - uint8_t working_buf[FF_MAX_SS]; - if (f_mkfs(&vfs->fatfs, FM_FAT, 0, working_buf, sizeof(working_buf)) != FR_OK) { - __fatal_error("Could not create LFS"); - } - - // Mark FS as OpenMV disk. - if (f_stat(&vfs->fatfs, "/.openmv_disk", NULL) != FR_OK) { - f_open(&vfs->fatfs, &fp, "/.openmv_disk", FA_WRITE | FA_CREATE_ALWAYS); - f_close(&fp); - } - - // Create default main.py - f_open(&vfs->fatfs, &fp, "/main.py", FA_WRITE | FA_CREATE_ALWAYS); - f_write(&fp, fresh_main_py, sizeof(fresh_main_py) - 1 /* don't count null terminator */, &n); - f_close(&fp); - - // Create readme file - f_open(&vfs->fatfs, &fp, "/README.txt", FA_WRITE | FA_CREATE_ALWAYS); - f_write(&fp, fresh_readme_txt, sizeof(fresh_readme_txt) - 1 /* don't count null terminator */, &n); - f_close(&fp); - - return 0; -} -#endif - bool mp_exec_bootscript(const char *path, bool interruptible, bool wifidbg_enabled) { nlr_buf_t nlr; bool interrupted = false; diff --git a/src/omv/common/mp_utils.h b/src/omv/common/mp_utils.h index e6c7e1e63..346240b5a 100644 --- a/src/omv/common/mp_utils.h +++ b/src/omv/common/mp_utils.h @@ -27,6 +27,5 @@ #define __MP_UTILS_H__ typedef struct _fs_user_mount_t fs_user_mount_t; void mp_init_gc_stack(void *stack_start, void *stack_end, void *heap_start, void *heap_end, size_t stack_limit); -int mp_init_filesystem(fs_user_mount_t *vfs); bool mp_exec_bootscript(const char *path, bool interruptible, bool wifidbg_enabled); #endif // __MP_UTILS_H__