From ca8fbbc2bea7b73146b2b53af9f8f0678fa998ed Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 9 Aug 2020 15:55:11 -0500 Subject: [PATCH] Shorthand values for M575 B --- Marlin/src/gcode/config/M575.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/config/M575.cpp b/Marlin/src/gcode/config/M575.cpp index 4144c366d..3aa584465 100644 --- a/Marlin/src/gcode/config/M575.cpp +++ b/Marlin/src/gcode/config/M575.cpp @@ -33,7 +33,21 @@ * B - Baud rate (bits per second) */ void GcodeSuite::M575() { - const int32_t baud = parser.ulongval('B'); + int32_t baud = parser.ulongval('B'); + switch (baud) { + case 24: + case 96: + case 192: + case 384: + case 576: + case 1152: baud *= 100; break; + case 250: + case 500: baud *= 1000; break; + case 19: baud = 19200; break; + case 38: baud = 38400; break; + case 57: baud = 57600; break; + case 115: baud = 115200; break; + } switch (baud) { case 2400: case 9600: case 19200: case 38400: case 57600: case 115200: case 250000: case 500000: case 1000000: {