Skip to content
Snippets Groups Projects
Commit 2b4d2ab2 authored by Lucas Stratmann's avatar Lucas Stratmann
Browse files

Made Arduino "reupload" safe

parent 42992f19
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ import tec.letsgoing.ardublock.simulator.view.GUI; ...@@ -28,6 +28,7 @@ import tec.letsgoing.ardublock.simulator.view.GUI;
/** /**
* Diese Klasse verwaltet alle Elemente des Simulators. Sie ist geschrieben als Singelton. * Diese Klasse verwaltet alle Elemente des Simulators. Sie ist geschrieben als Singelton.
* Daher wird die Instanz über getInstance geholt und der Konstruktor ist private.
* *
* *
* Pinmapping: * Pinmapping:
...@@ -162,6 +163,7 @@ public class Simulator implements Runnable, ActionListener { ...@@ -162,6 +163,7 @@ public class Simulator implements Runnable, ActionListener {
*/ */
public boolean resetFunctions() { public boolean resetFunctions() {
functionsCode.clear(); functionsCode.clear();
arduino.resetFunctions();
arduino.reset(); arduino.reset();
return true; return true;
} }
......
...@@ -115,6 +115,10 @@ public class Arduino { ...@@ -115,6 +115,10 @@ public class Arduino {
} }
return true; return true;
} }
public void resetFunctions() {
functions.clear();
}
public void serialPrint(String content) { public void serialPrint(String content) {
gui.serialPrint(content); gui.serialPrint(content);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment