im-pro-at / cncgcodecontroller

CNC-GCode-Controller
MIT License
145 stars 59 forks source link

NRSerial Baudrate check is stopping serial options in NRSerial #40

Open LucidWolf opened 5 years ago

LucidWolf commented 5 years ago

The NRSerial.setBaud() filters out some of the provided options.
I think you should use the same array for the baud selection as you setBaud check. Or not check it at all since your are setting the list in the GUI and there would be no way to send anything that is not already listed. Correct?

Is there a reason you distinguish between JS and NR baud rates? Maybe just have AComCore.getPortsSpeeds() list the baud speeds you allow.

From NRSerial

public void setBaud(int baud) { switch(baud){ case 2400: case 4800: case 9600: case 14400: case 19200: case 28800: case 38400: case 57600: case 76800: case 115200: case 230400: case 250000: //Added to stop invalid (Arduino happy baud) case 256000: //Added to stop invalid this.baud = baud; return; default: throw new RuntimeException("Invalid baudrate! "+baud); } }

Also don't know whats up the the code tag not working on Github... so i didn't use it

Fixing it your code works for me and I love it thank you.
Been looking for a good MPCNC with Repetier firmware controller. Since i run on the SD card but want to add bed leveling to my g-code.