From a7c25f19d9700c008e6d6b5b4f95ea6103bda8ab Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sat, 25 Jun 2022 07:42:25 +0530 Subject: fixes --- circuitpython/supervisor/shared/filesystem.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'circuitpython/supervisor/shared/filesystem.c') diff --git a/circuitpython/supervisor/shared/filesystem.c b/circuitpython/supervisor/shared/filesystem.c index 5a22a4b..5be6e8d 100644 --- a/circuitpython/supervisor/shared/filesystem.c +++ b/circuitpython/supervisor/shared/filesystem.c @@ -71,17 +71,20 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { - #if CIRCUITPY_FULL_BUILD FIL fs; UINT char_written = 0; - const byte buffer[] = "import picoducky\nmain()\n"; + UINT boot_char_written = 0; + const byte buffer[] = "import raspiducky\nraspiducky.main()\n"; + const byte bootbuffer[] = "import storage\nstorage.disable_usb_drive()\n"; + // Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); f_close(&fs); - #else - make_empty_file(fatfs, "/code.py"); - #endif + + f_open(fatfs, &fs, "/boot.py", FA_WRITE | FA_CREATE_ALWAYS); + f_write(&fs, bootbuffer, sizeof(bootbuffer) - 1, &boot_char_written); + f_close(&fs); } // we don't make this function static because it needs a lot of stack and we -- cgit v1.2.3