AP_HAL_AVR: Dataflash debugging

This commit is contained in:
Pat Hickey 2012-12-05 17:16:12 -08:00 committed by Andrew Tridgell
parent ff09314ab8
commit 2826a605ba
1 changed files with 9 additions and 1 deletions

View File

@ -21,7 +21,15 @@ void CommonDataflash::erase_all() {
bool CommonDataflash::need_erase() {
start_read(_num_pages+1);
return (read_dword() != DF_LOGGING_FORMAT);
uint32_t fmtbyte = read_dword();
if (fmtbyte != DF_LOGGING_FORMAT) {
hal.console->printf_P(
PSTR("logging fmt got %lX expected %lX\r\n"),
fmtbyte, DF_LOGGING_FORMAT);
return true;
} else {
return false;
}
}
void CommonDataflash::start_write(int16_t page) {