AP_HAL: Unify from print or println to printf.

This commit is contained in:
murata 2017-01-21 13:37:51 +09:00 committed by Andrew Tridgell
parent af47a8e91c
commit 03bf57219b
6 changed files with 6 additions and 6 deletions

View File

@ -15,7 +15,7 @@ void loop (void)
{ {
float v = ch->voltage_average(); float v = ch->voltage_average();
if (pin == 0) { if (pin == 0) {
hal.console->println(); hal.console->printf("\n");
} }
hal.console->printf("[%u %.3f] ", hal.console->printf("[%u %.3f] ",
(unsigned)pin, v); (unsigned)pin, v);

View File

@ -4,7 +4,7 @@
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); const AP_HAL::HAL& hal = AP_HAL::get_HAL();
void setup(void) { void setup(void) {
hal.console->println("Starting Printf test"); hal.console->printf("Starting Printf test\n");
} }
static const struct { static const struct {

View File

@ -39,7 +39,7 @@ void loop(void)
for (uint8_t i = 0; i < max_channels_display; i++) { for (uint8_t i = 0; i < max_channels_display; i++) {
hal.console->printf("%2u:%04u ", (unsigned)i+1, (unsigned)last_value[i]); hal.console->printf("%2u:%04u ", (unsigned)i+1, (unsigned)last_value[i]);
} }
hal.console->println(); hal.console->printf("\n");
} }
} else { } else {
hal.console->printf("Channels detected: %2u\n", nchannels); hal.console->printf("Channels detected: %2u\n", nchannels);

View File

@ -46,7 +46,7 @@ void loop(void)
for(uint8_t i = 0; i < max_channels; i++) { for(uint8_t i = 0; i < max_channels; i++) {
hal.console->printf("%2u:%04u ", (unsigned)i + 1, (unsigned)last_value[i]); hal.console->printf("%2u:%04u ", (unsigned)i + 1, (unsigned)last_value[i]);
} }
hal.console->println(); hal.console->printf("\n");
} }
hal.scheduler->delay(100); hal.scheduler->delay(100);
} }

View File

@ -8,7 +8,7 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL();
void setup (void) void setup (void)
{ {
hal.console->println("Starting AP_HAL::RCOutput test"); hal.console->printf("Starting AP_HAL::RCOutput test\n");
for (uint8_t i=0; i<14; i++) { for (uint8_t i=0; i<14; i++) {
hal.rcout->enable_ch(i); hal.rcout->enable_ch(i);
} }

View File

@ -72,7 +72,7 @@ const struct Menu::command rcoutput_menu_commands[] = {
MENU(menu, "Menu: ", rcoutput_menu_commands); MENU(menu, "Menu: ", rcoutput_menu_commands);
void setup(void) { void setup(void) {
hal.console->println("Starting AP_HAL::RCOutput test"); hal.console->printf("Starting AP_HAL::RCOutput test\n");
for (uint8_t i = 0; i < 14; i++) { for (uint8_t i = 0; i < 14; i++) {
hal.rcout->enable_ch(i); hal.rcout->enable_ch(i);