![](/media/cache/profiles/0f0ee3310223fe38a989b2c818709393.50x50_q85.jpg)
Generate up to 8 different digital waeforms from serial port
jmInterpreter.c
- Committer:
- jm
- Date:
- 2011-02-12
- Revision:
- 0:374d47623fab
File content as of revision 0:374d47623fab:
/************************************************************************* * @file jmInterpreter.c * @brief Command Line Interpreter * * @date December 27,2010 */ #include "jmInterpreter.h" #include "jmRingBuffer.h" #include "jmCommands.h" /** @brief Interpret a command line. * Interpreter uses Command Line Buffer to fecth command name * and redirects execution to associated function. * @param none * @returns none */ void Interpret(void){ unsigned int i,k; unsigned char Command, found; char Word[WordMaxSize]; Command =0; found = 0; if(NotEmpty(pLine)){ ExtractWord(pLine,Word); // Command name extraction for(i=0, k=0;i<sizeof(cmdNames);i++){ // lookup in names array if(cmdNames[i]!=Word[k]){ // if different while(cmdNames[i]!=0)i++; // next entry in names array Command++; // update command index k=0; } else{ if(Word[k]==0){ found=1; } else k++; } //else if(found)break; } //for } // Command execution Action(Command); }