library to modify and read program variable in runtime from a serial console. You can reset as well the mbed from the console without pushing buttons. Handy for debugging from the online compiler as you can change the behavior of the program without need to recompile each time.
Diff: VarStore.cpp
- Revision:
- 4:4be2eaf872df
- Parent:
- 3:cf43e6de918e
- Child:
- 5:47b67a7c0bb7
diff -r cf43e6de918e -r 4be2eaf872df VarStore.cpp --- a/VarStore.cpp Mon Aug 25 11:07:49 2014 +0000 +++ b/VarStore.cpp Mon Aug 25 12:39:23 2014 +0000 @@ -42,6 +42,8 @@ VarItem *V; char *Name; + pc->printf("VarStore Set %s\n",Input); + if(Input [0] == 's') { strtok(Input,":"); Name=strtok(NULL,":"); @@ -136,18 +138,18 @@ } else { if(c=='\r') { Cs[ci_counter]='\0'; - MyThis->pc->printf(" CI -%s- \n",Cs); +// MyThis->pc->printf(" CI -%s- \n",Cs); ret=MyThis->Do(Cs,MyThis); ci_counter=0; Cs[0]='\0'; // MyThis->pc->printf(" set variable (%d)\n",ret); // MyThis->pc->printf(" Get offset -%s- \n",MyThis->Get("offset")); } else { -// MyThis->pc->printf(" CI -%s- -%c- -%d- \n",Cs,c,ci_counter); +// MyThis->pc->printf(" CI -%s- -%c- -%d- \n",Cs,c,ci_counter); Cs[ci_counter]=c; ci_counter++; - // MyThis->pc->printf(" parcial CI -%s- -%c-(%c) -%d- \n",Cs,c,Cs[ci_counter],ci_counter); +// MyThis->pc->printf(" parcial CI -%s- -%c-(%c) -%d- \n",Cs,c,Cs[ci_counter],ci_counter); } } } @@ -157,7 +159,7 @@ MyThis->pc->printf(" error setting/getting var \n"); ret=STR_OK; } - Thread::wait(100); + //Thread::wait(10); } // While }