Browse Source

Added comments.

Thomas Buck 12 years ago
parent
commit
4bd60b795a
2 changed files with 3 additions and 3 deletions
  1. 1
    3
      CubeControl/HelperUtility.java
  2. 2
    0
      CubeControl/SerialHelper.java

+ 1
- 3
CubeControl/HelperUtility.java View File

39
 	// Inspired by:
39
 	// Inspired by:
40
 	// http://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-include-dll-files
40
 	// http://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-include-dll-files
41
 	static {
41
 	static {
42
-		// System.out.println("Loading Serial Library...");
43
 		loadFromJar();
42
 		loadFromJar();
44
-		// System.out.println("Loaded!");
45
 	}
43
 	}
46
 
44
 
47
 	/**
45
 	/**
55
 			loadLib(path, "Serial.dll");
53
 			loadLib(path, "Serial.dll");
56
 		} else if (os.indexOf("mac") > -1) {
54
 		} else if (os.indexOf("mac") > -1) {
57
 			loadLib(path, "libSerial.jnilib");
55
 			loadLib(path, "libSerial.jnilib");
58
-		} else {
56
+		} else { // Hopefully unix/linux...
59
 			loadLib(path, "libSerial.so");
57
 			loadLib(path, "libSerial.so");
60
 		}
58
 		}
61
 	}
59
 	}

+ 2
- 0
CubeControl/SerialHelper.java View File

283
 		while (!t.dataWasSent()) {
283
 		while (!t.dataWasSent()) {
284
 			if ((new Date()).getTime() >= (startdate + (data.length * 1000))) {
284
 			if ((new Date()).getTime() >= (startdate + (data.length * 1000))) {
285
 				// More than (length * 1000) milliseconds went by
285
 				// More than (length * 1000) milliseconds went by
286
+				// => 1 second per byte
286
 				return false;
287
 				return false;
287
 			}
288
 			}
288
 		}
289
 		}
298
 		while (!t.dataIsReady()) {
299
 		while (!t.dataIsReady()) {
299
 			if ((new Date()).getTime() >= (startdate + (length * 1000))) {
300
 			if ((new Date()).getTime() >= (startdate + (length * 1000))) {
300
 				// More than (length * 1000) milliseconds went by
301
 				// More than (length * 1000) milliseconds went by
302
+				// => 1 second per byte
301
 				return null;
303
 				return null;
302
 			}
304
 			}
303
 		}
305
 		}

Loading…
Cancel
Save