1
0
Эх сурвалжийг харах

Add reset command when the java tool quits

Baglio Tabifata 5 жил өмнө
parent
commit
2a63bdf161

+ 6 - 1
src/main/java/info/hkzlab/dupal/analyzer/App.java

@@ -47,7 +47,12 @@ public class App {
             System.exit(-1);
         } 
 
-        
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override
+            public void run() {
+                dpci.reset();
+            }
+        });
 
         dpan.startAnalisys();
     }

+ 4 - 0
src/main/java/info/hkzlab/dupal/analyzer/board/boardio/DuPALCmdInterface.java

@@ -23,6 +23,10 @@ public class DuPALCmdInterface {
         this.palSpecs = palSpecs;
     }
 
+    public void reset() {
+        dpm.writeCommand(DuPALProto.buildRESETCommand());
+    }
+
     public int read() {
         dpm.writeCommand(DuPALProto.buildREADCommand());
         return DuPALProto.handleREADResponse(dpm.readResponse());