diff options
| author | Ayan Pahwa <iayanpahwa@gmail.com> | 2019-11-23 20:58:33 +0530 |
|---|---|---|
| committer | Ayan Pahwa <iayanpahwa@gmail.com> | 2019-11-23 20:58:33 +0530 |
| commit | 180b485f8b109baf64252a4b9793a37377af8c25 (patch) | |
| tree | 111e0a4851e09496182be782219f12a0dc4358da /supervisor | |
| parent | 262cfd4ea3f80697baf8ca2ccfe63ec243c02870 (diff) | |
Enable creation of code.py only for full builds
Diffstat (limited to 'supervisor')
| -rw-r--r-- | supervisor/shared/filesystem.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 261c48172..b4f6d8bb9 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -75,10 +75,15 @@ static void make_sample_code_file(FATFS *fatfs) { UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; + #if CIRCUITPY_FULL_BUILD == 0 + make_empty_file(&vfs_fat->fatfs, "/code.py"); + + #else //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); + #endif } // we don't make this function static because it needs a lot of stack and we |
