Karpova Lab fork of stateScript

Dependencies:   SMARTWAV mbed

Fork of stateScript_v2 by Mattias Karlsson

Files at this revision

API Documentation at this revision

Comitter:
alustig3
Date:
Fri Dec 11 16:27:38 2015 +0000
Parent:
3:d7b0a0890d96
Commit message:
Can now send "kaboom;" to reset the mbed through software

Changed in this revision

behave.cpp Show annotated file Show diff for this revision Revisions of this file
behave.h Show annotated file Show diff for this revision Revisions of this file
--- a/behave.cpp	Sat Oct 10 22:37:17 2015 +0000
+++ b/behave.cpp	Fri Dec 11 16:27:38 2015 +0000
@@ -2669,7 +2669,9 @@
 
                 //int is used to decalar new variables.  Only allowed outside of callbacks-------------------
                 //example: int a;  int b = 9
-            } else if (tokens[i].compare("int") == 0) { //define a new integer variable
+            }else if(tokens[i].compare("kaboom") == 0){//send "kaboom;" to reset mbed
+                mbed_reset();            
+            }else if (tokens[i].compare("int") == 0) { //define a new integer variable
                 textDisplay.debug("Int statement\r\n");
                 if (ifBlockInit || whileBlockInit || expectingDoStatement) {
                     textDisplay << "Error: expected a 'do' statement\r\n";
--- a/behave.h	Sat Oct 10 22:37:17 2015 +0000
+++ b/behave.h	Fri Dec 11 16:27:38 2015 +0000
@@ -42,6 +42,8 @@
 #define OR_CONDITION    1
 #define AND_CONDITION    2
 
+extern "C" void mbed_reset();//reset mbed through software
+
 
 
 using namespace std;