From f495ea476087511c4e6c40cb5920eaff1bb17813 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 23 Nov 2021 10:47:46 -0600 Subject: [PATCH] Don't use reset reason to skip writing boot_out.txt As @neradoc and @anecdata noted, we can't depend on the reset reason. Instead, just rely on the existing safe mode logic (the write already is skipped anytime boot.py was skipped), and otherwise potentially write boot_out.txt anytime it differs from the version on disk (or if the file doesn't exist in the first place) Testing performed: On qtpy m0 haxpress, removed boot_out.txt and clicked reset button. verified boot_out.txt was recreated. Closes #5588 --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index a189add5e2..89b1f492d6 100644 --- a/main.c +++ b/main.c @@ -678,7 +678,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { FATFS *fs = &vfs->fatfs; boot_output = NULL; - bool write_boot_output = (common_hal_mcu_processor_get_reset_reason() == RESET_REASON_POWER_ON); + bool write_boot_output = true; FIL boot_output_file; if (f_open(fs, &boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_READ) == FR_OK) { char *file_contents = m_new(char, boot_text.alloc);