From fc214fb320cd91f3477945ca24ba777e71c9d602 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 6 May 2018 23:48:11 -0400 Subject: [PATCH 1/2] boot.py change of filesystem writability would get overridden. --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index af847976ce..2b6a6ad281 100644 --- a/main.c +++ b/main.c @@ -311,6 +311,10 @@ int __attribute__((used)) main(void) { filesystem_writable_by_python(true); f_open(fs, boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS); + // Switch the filesystem back to non-writable now instead of later, + // since boot.py might change it back to writable. + filesystem_writable_by_python(false); + // Write version info to boot_out.txt. mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO); mp_hal_stdout_tx_str("\r\n"); @@ -327,7 +331,6 @@ int __attribute__((used)) main(void) { filesystem_flush(); boot_output_file = NULL; } - filesystem_writable_by_python(false); #endif // Reset to remove any state that boot.py setup. It should only be used to From 224e245e05d12e7261a9c0ff31406efc7bdaf806 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 7 May 2018 00:08:26 -0400 Subject: [PATCH 2/2] clarify comment --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 2b6a6ad281..bc37fa8711 100644 --- a/main.c +++ b/main.c @@ -311,7 +311,7 @@ int __attribute__((used)) main(void) { filesystem_writable_by_python(true); f_open(fs, boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS); - // Switch the filesystem back to non-writable now instead of later, + // Switch the filesystem back to non-writable by Python now instead of later, // since boot.py might change it back to writable. filesystem_writable_by_python(false);