terminal: trying to fix Print API usage

- more static flash strings and flash string formats
- println() will write \r\n when we mostly just use the \n
(and avoid mixing it up in the same function)
This commit is contained in:
Maxim Prokhorov
2021-04-03 19:37:26 +03:00
parent 8ffd026a6a
commit b80a2e9ffa
8 changed files with 58 additions and 52 deletions

View File

@@ -832,13 +832,14 @@ void buttonSetup() {
terminalRegisterCommand(F("BUTTON"), [](const terminal::CommandContext& ctx) {
unsigned index { 0u };
for (auto& button : _buttons) {
ctx.output.printf("%u - ", index++);
ctx.output.printf_P(PSTR("%u - "), index++);
if (button.event_emitter) {
auto& pin = button.event_emitter->pin();
ctx.output.println(pin->description());
ctx.output.print(pin->description());
} else {
ctx.output.println(F("Virtual"));
ctx.output.print(F("Virtual"));
}
ctx.output.print('\n');
}
terminalOK(ctx);