Log_simple uses identical implementation of do_erase_logs.

* fix build1280.ArduCopter
This commit is contained in:
Pat Hickey 2011-12-22 13:31:28 -08:00
parent 4a53c4e795
commit 343228c8cc
1 changed files with 16 additions and 0 deletions

View File

@ -131,6 +131,22 @@ erase_logs(uint8_t argc, const Menu::arg *argv)
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
process_logs(uint8_t argc, const Menu::arg *argv)
{