Browse Source

Shorthand values for M575 B

Scott Lahteine 5 years ago
parent
commit
f7b261a363
1 changed files with 15 additions and 1 deletions
  1. 15
    1
      Marlin/src/gcode/config/M575.cpp

+ 15
- 1
Marlin/src/gcode/config/M575.cpp View File

@@ -33,7 +33,21 @@
33 33
  *   B<baudrate> - Baud rate (bits per second)
34 34
  */
35 35
 void GcodeSuite::M575() {
36
-  const int32_t baud = parser.ulongval('B');
36
+  int32_t baud = parser.ulongval('B');
37
+  switch (baud) {
38
+    case   24:
39
+    case   96:
40
+    case  192:
41
+    case  384:
42
+    case  576:
43
+    case 1152: baud *= 100; break;
44
+    case  250:
45
+    case  500: baud *= 1000; break;
46
+    case   19: baud = 19200; break;
47
+    case   38: baud = 38400; break;
48
+    case   57: baud = 57600; break;
49
+    case  115: baud = 115200; break;
50
+  }
37 51
   switch (baud) {
38 52
     case 2400: case 9600: case 19200: case 38400: case 57600:
39 53
     case 115200: case 250000: case 500000: case 1000000: {

Loading…
Cancel
Save