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
This commit is contained in:
parent
387a8a46b3
commit
f495ea4760
2
main.c
2
main.c
|
@ -678,7 +678,7 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
|
||||||
FATFS *fs = &vfs->fatfs;
|
FATFS *fs = &vfs->fatfs;
|
||||||
|
|
||||||
boot_output = NULL;
|
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;
|
FIL boot_output_file;
|
||||||
if (f_open(fs, &boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_READ) == FR_OK) {
|
if (f_open(fs, &boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_READ) == FR_OK) {
|
||||||
char *file_contents = m_new(char, boot_text.alloc);
|
char *file_contents = m_new(char, boot_text.alloc);
|
||||||
|
|
Loading…
Reference in New Issue