|
|
@ -131,6 +131,22 @@ erase_logs(uint8_t argc, const Menu::arg *argv) |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
|
|
|
do_erase_logs(void (*delay_cb)(unsigned long)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Serial.printf_P(PSTR("\nErasing log...\n")); |
|
|
|
|
|
|
|
DataFlash.SetFileNumber(0xFFFF); |
|
|
|
|
|
|
|
for(int j = 1; j <= DF_LAST_PAGE; j++) { |
|
|
|
|
|
|
|
DataFlash.PageErase(j); |
|
|
|
|
|
|
|
DataFlash.StartWrite(j); // We need this step to clean FileNumbers |
|
|
|
|
|
|
|
if(j%128 == 0) Serial.printf_P(PSTR("+")); |
|
|
|
|
|
|
|
delay_cb(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.printf_P(PSTR("\nLog erased.\n")); |
|
|
|
|
|
|
|
DataFlash.FinishWrite(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int8_t |
|
|
|
static int8_t |
|
|
|
process_logs(uint8_t argc, const Menu::arg *argv) |
|
|
|
process_logs(uint8_t argc, const Menu::arg *argv) |
|
|
|
{ |
|
|
|
{ |
|
|
|