diff --git a/src/net/ash/HIDToVPADNetworkClient/controller/Controller.java b/src/net/ash/HIDToVPADNetworkClient/controller/Controller.java index 0467f08..44b0df7 100644 --- a/src/net/ash/HIDToVPADNetworkClient/controller/Controller.java +++ b/src/net/ash/HIDToVPADNetworkClient/controller/Controller.java @@ -62,7 +62,7 @@ public abstract class Controller implements Runnable{ if(newData != null){ setLatestData(newData); } - Utilities.sleep(10); + doSleepAfterPollingData(); } synchronized (shutdownLock) { shutdownState = shutdown; @@ -73,6 +73,10 @@ public abstract class Controller implements Runnable{ } } + protected void doSleepAfterPollingData() { + Utilities.sleep(10); + } + @Synchronized("dataLock") private void setLatestData(byte[] newData) { this.latestData = newData; diff --git a/src/net/ash/HIDToVPADNetworkClient/controller/LinuxDevInputController.java b/src/net/ash/HIDToVPADNetworkClient/controller/LinuxDevInputController.java index 6eef7a7..82bde01 100644 --- a/src/net/ash/HIDToVPADNetworkClient/controller/LinuxDevInputController.java +++ b/src/net/ash/HIDToVPADNetworkClient/controller/LinuxDevInputController.java @@ -125,6 +125,11 @@ public class LinuxDevInputController extends Controller implements Runnable{ } return newData; } + + @Override + protected void doSleepAfterPollingData() { + //This is event driven (aka pollLatestData() is blocking anyway until we have data), we don't need to sleep it all. + } @Override public void destroyDriver() {