Shorthand values for M575 B

This commit is contained in:
Scott Lahteine 2020-08-09 15:55:11 -05:00
parent 837dc4727d
commit f7b261a363

View file

@ -33,7 +33,21 @@
* B<baudrate> - Baud rate (bits per second) * B<baudrate> - Baud rate (bits per second)
*/ */
void GcodeSuite::M575() { 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) { switch (baud) {
case 2400: case 9600: case 19200: case 38400: case 57600: case 2400: case 9600: case 19200: case 38400: case 57600:
case 115200: case 250000: case 500000: case 1000000: { case 115200: case 250000: case 500000: case 1000000: {