File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/com/neuronrobotics/sdk/pid Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ public class VirtualGenericPIDDevice extends GenericPIDDevice implements IHardwa
3232 private ArrayList <PDVelocityConfiguration > PDconfigs = new ArrayList <PDVelocityConfiguration >();
3333
3434 /** The sync. */
35- SyncThread sync = new SyncThread ();
35+ private SyncThread sync = new SyncThread ();
36+ private boolean runSync =false ;
3637
3738 /** The max ticks per second. */
3839 private double maxTicksPerSecond ;
@@ -366,7 +367,7 @@ public void run() {
366367 PIDConfiguration [] toUpdate = new PIDConfiguration [numChannels ] ;
367368 int updateIndex =0 ;
368369 long time ;
369- while (true ) {
370+ while (runSync ) {
370371 try {
371372 Thread .sleep (threadTime );
372373 } catch (InterruptedException ex ) {
@@ -442,7 +443,7 @@ public boolean connect() {
442443 @ Override
443444 public void disconnect () {
444445 fireDisconnectEvent ();
445-
446+ runSync = false ;
446447 }
447448
448449}
You can’t perform that action at this time.
0 commit comments