Pārlūkot izejas kodu

Merge branch 'master' of github.com:xythobuz/LED-Cube

Max Nuding 13 gadus atpakaļ
vecāks
revīzija
8217d9a993
2 mainītis faili ar 6 papildinājumiem un 6 dzēšanām
  1. 1
    1
      Cube Control/frame.java
  2. 5
    5
      Cube Control/helper/winSerial.c

+ 1
- 1
Cube Control/frame.java Parādīt failu

@@ -96,7 +96,7 @@ public class frame extends JFrame implements ListSelectionListener {
96 96
   }
97 97
 
98 98
   public void valueChanged(ListSelectionEvent evt) {
99
-    if (!evt.getValueIsAdjusting()) {
99
+    if ((!evt.getValueIsAdjusting()) && (evt.getSource() != animList) && (evt.getSource() != frameList)) {
100 100
      DefaultListModel model = (DefaultListModel)((JList)evt.getSource()).getModel();
101 101
      int anim = animList.getSelectedIndex();
102 102
      int max;

+ 5
- 5
Cube Control/helper/winSerial.c Parādīt failu

@@ -60,11 +60,11 @@ int serialOpen(char *port) {
60 60
 		return -1;
61 61
 	}
62 62
 	
63
-	timeouts.ReadIntervalTimeout = 50;
64
-	timeouts.ReadTotalTimeoutConstant = 50;
65
-	timeouts.ReadTotalTimeoutMultiplier = 10;
66
-	timeouts.WriteTotalTimeoutConstant = 50;
67
-	timeouts.WriteTotalTimeoutMultiplier = 10;
63
+	timeouts.ReadIntervalTimeout = 1000 * dwReadTimeOutIntervalInSec;
64
+	timeouts.ReadTotalTimeoutConstant = 1000 * dwReadTimeOutIntervalInSec;
65
+	timeouts.ReadTotalTimeoutMultiplier = 1000 * dwReadTimeOutIntervalInSec;
66
+	timeouts.WriteTotalTimeoutConstant = 1000 * dwReadTimeOutIntervalInSec;
67
+	timeouts.WriteTotalTimeoutMultiplier = 1000 * dwReadTimeOutIntervalInSec;
68 68
 
69 69
 	if (!SetCommTimeouts(hSerial, &timeouts)) {
70 70
 		CloseHandle(hSerial);

Notiek ielāde…
Atcelt
Saglabāt