mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Log fatal errors to file
This commit is contained in:
parent
4376e87609
commit
fa12a1a704
@ -105,8 +105,14 @@ void flash_error(int n) {
|
||||
}
|
||||
|
||||
void __fatal_error(const char *msg) {
|
||||
printf("\nFATAL ERROR:\n");
|
||||
printf(msg);
|
||||
FIL fp;
|
||||
if (f_open(&fp, "ERROR.LOG",
|
||||
FA_WRITE|FA_CREATE_ALWAYS) == FR_OK) {
|
||||
f_printf(&fp, "\nFATAL ERROR:\n%s\n", msg);
|
||||
}
|
||||
f_close(&fp);
|
||||
storage_flush();
|
||||
|
||||
for (uint i = 0;;) {
|
||||
led_toggle(((i++) & 3));
|
||||
for (volatile uint delay = 0; delay < 500000; delay++) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user