Minor serial code cleanup

This commit is contained in:
Scott Lahteine
2021-02-12 19:33:19 -06:00
parent d4fb372899
commit fd2477923c
6 changed files with 16 additions and 17 deletions

View File

@ -53,14 +53,10 @@ void GcodeSuite::M118() {
}
#if HAS_MULTI_SERIAL
const int8_t old_serial = multiSerial.portMask;
if (WITHIN(port, 0, NUM_SERIAL))
multiSerial.portMask = port ? _BV(port - 1) : SERIAL_ALL;
PORT_REDIRECT(WITHIN(port, 0, NUM_SERIAL) ? (port ? _BV(port - 1) : SERIAL_ALL) : multiSerial.portMask);
#endif
if (hasE) SERIAL_ECHO_START();
if (hasA) SERIAL_ECHOPGM("//");
SERIAL_ECHOLN(p);
TERN_(HAS_MULTI_SERIAL, multiSerial.portMask = old_serial);
}