![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
perturb room
Fork of stateScript by
Diff: behave.h
- Revision:
- 5:4d6575e3a07e
- Parent:
- 4:34aca2142df9
--- a/behave.h Thu Sep 25 23:42:30 2014 +0000 +++ b/behave.h Mon May 18 01:17:58 2015 +0000 @@ -21,10 +21,9 @@ #define OR_CONDITION 1 #define AND_CONDITION 2 -#define NUMPORTS 8 +#define NUMPORTS 10 -#define INPUTCHARBUFFERSIZE 3072 - +extern "C" void mbed_reset();//MAX and ANDY class event; //we foreward declare this because of class interdependencies //used in the digital port class to organize digital change events @@ -38,6 +37,7 @@ class digitalPort { public: digitalPort(DigitalOut* DOP, DigitalIn* DIP); + digitalPort(DigitalOut* DOP); void setDigitalOut(int outVal); //int getDigitalOut(); int getDigitalIn(); @@ -386,25 +386,6 @@ action* actionPtr; }; -class blockBuffer { - -public: - blockBuffer(); - bool addLine(char* input, int numChars); - string getNextLine(); - int16_t linesAvailable(); - bool empty(); - void resetBuffer(); - -private: - //__attribute((section("AHBSRAM1"),aligned)) char charBuffer[INPUTCHARBUFFERSIZE]; - char charBuffer[INPUTCHARBUFFERSIZE]; - int16_t bufferWritePos; - int16_t bufferReadPos; - int16_t _linesAvailable; - -}; - //Parser for the incoming text. The parser is called when a line terminates with a semicolon (;). //Only the final line in a callback block should have a semicolon. class scriptStream { @@ -423,15 +404,13 @@ int getRandomParam(string expression); - - private: int currentTriggerPort; int currentTriggerDir; int currentPort; int currentFunction; - + string tmpLine; vector<string> tokens; @@ -448,8 +427,7 @@ vector<intVariable*> globalVariables; vector<event*> tmpEventPtrArray; vector<functionItem*> functionArray; //any blocks declared outsite callback blocks are stored here - //list<string> currentBlock; - blockBuffer currentBlock; + list<string> currentBlock; digitalPort** portVector;