balthisar / cncjs-pendant-gamepad

Use a Videogame Controller as a CNCjs Pendant
MIT License
11 stars 6 forks source link

Stop the pendant from creating a snowball effect with open serial requests #9

Open danhigham opened 1 year ago

danhigham commented 1 year ago

The current code for the pendant will cause the host CPU to eventually peg as when CNCjs is not connected to a controller it creates a new interval thread to try and connect every two seconds. Only one interval needs to created the first time it fails to connect.

I have also changed the interval to five seconds, two is a little aggressive.

Also, in the latest version of CNCjs, the alias for Grbl controller type was changed from 'grbl' to 'Grbl', I included a fix for this also.