DataFlash: Unify from print or println to printf.

This commit is contained in:
murata 2017-01-21 13:45:48 +09:00 committed by Andrew Tridgell
parent 30bbe7abb6
commit 1b2ea27a68
4 changed files with 15 additions and 15 deletions

View File

@ -1005,7 +1005,7 @@ void DataFlash_File::ListAvailableLogs(AP_HAL::BetterStream *port)
}
}
#endif
port->println();
port->printf("\n");
}
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX

View File

@ -119,14 +119,14 @@ uint16_t DataFlash_Block::start_new_log(void)
uint16_t last_page = find_last_page();
StartRead(last_page);
//Serial.print("last page: "); Serial.println(last_page);
//Serial.print("file #: "); Serial.println(GetFileNumber());
//Serial.print("file page: "); Serial.println(GetFilePage());
//Serial.printf("last page: "); Serial.printf("%u\n", last_page);
//Serial.printf("file #: "); Serial.printf("%u\n", GetFileNumber());
//Serial.printf("file page: "); Serial.printf("%u\n", GetFilePage());
if(find_last_log() == 0 || GetFileNumber() == 0xFFFF) {
SetFileNumber(1);
StartWrite(1);
//Serial.println("start log from 0");
//Serial.printf("start log from 0\n");
log_write_started = true;
return 1;
}
@ -497,7 +497,7 @@ void DataFlash_Backend::_print_log_entry(uint8_t msg_type,
port->printf(", ");
}
}
port->println();
port->printf("\n");
}
/*
@ -594,7 +594,7 @@ void DataFlash_Block::DumpPageInfo(AP_HAL::BetterStream *port)
void DataFlash_Block::ShowDeviceInfo(AP_HAL::BetterStream *port)
{
if (!CardInserted()) {
port->println("No dataflash inserted");
port->printf("No dataflash inserted\n");
return;
}
ReadManufacturerID();
@ -635,7 +635,7 @@ void DataFlash_Block::ListAvailableLogs(AP_HAL::BetterStream *port)
break;
}
}
port->println();
port->printf("\n");
}
// This function starts a new log file in the DataFlash, and writes

View File

@ -181,7 +181,7 @@ void DataFlashTest_AllTypes::Log_Write_TypeMessages_Log_Write()
void DataFlashTest_AllTypes::setup(void)
{
hal.console->println("Dataflash All Types 1.0");
hal.console->printf("Dataflash All Types 1.0\n");
dataflash.Init(log_structure, ARRAY_SIZE(log_structure));
@ -190,7 +190,7 @@ void DataFlashTest_AllTypes::setup(void)
dataflash.ShowDeviceInfo(hal.console);
if (dataflash.NeedPrep()) {
hal.console->println("Preparing dataflash...");
hal.console->printf("Preparing dataflash...\n");
dataflash.Prep();
}

View File

@ -43,14 +43,14 @@ void DataFlashTest::setup(void)
{
dataflash.Init(log_structure, ARRAY_SIZE(log_structure));
hal.console->println("Dataflash Log Test 1.0");
hal.console->printf("Dataflash Log Test 1.0\n");
// Test
hal.scheduler->delay(20);
dataflash.ShowDeviceInfo(hal.console);
if (dataflash.NeedPrep()) {
hal.console->println("Preparing dataflash...");
hal.console->printf("Preparing dataflash...\n");
dataflash.Prep();
}
@ -59,9 +59,9 @@ void DataFlashTest::setup(void)
dataflash.StartNewLog();
log_num = dataflash.find_last_log();
hal.console->printf("Using log number %u\n", log_num);
hal.console->println("After testing perform erase before using DataFlash for logging!");
hal.console->println("");
hal.console->println("Writing to flash... wait...");
hal.console->printf("After testing perform erase before using DataFlash for logging!\n");
hal.console->printf("\n");
hal.console->printf("Writing to flash... wait...\n");
uint32_t total_micros = 0;
uint16_t i;