diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2022-06-25 07:42:25 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2022-06-25 07:42:25 +0530 |
commit | a7c25f19d9700c008e6d6b5b4f95ea6103bda8ab (patch) | |
tree | 8707e464bc290613efae031908063ef9788cbb0d /circuitpython/supervisor/shared | |
parent | 08422ad7e5ae71a1a625e8a2bda6d233fd68ceee (diff) |
fixes
Diffstat (limited to 'circuitpython/supervisor/shared')
-rw-r--r-- | circuitpython/supervisor/shared/filesystem.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 |