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:
- 5:47b67a7c0bb7
- Parent:
- 4:4be2eaf872df
- Child:
- 6:9848fdaf2ad9
--- a/VarStore.cpp Mon Aug 25 12:39:23 2014 +0000 +++ b/VarStore.cpp Mon Aug 25 14:58:42 2014 +0000 @@ -115,9 +115,9 @@ * ********************************/ -void VarStore::Worker(void const *args) +void VarStore::Worker2() { - VarStore *MyThis=(VarStore *)args; + char c, *ret=STR_OK;// not NULL to start in no error state int ci_counter=0; @@ -155,7 +155,6 @@ } if(ret==NULL) { - Thread::wait(100); MyThis->pc->printf(" error setting/getting var \n"); ret=STR_OK; } @@ -167,6 +166,22 @@ * * ********************************/ +void VarStore::Worker(void const *args) +{ + + VarStore::MyThis=(VarStore *)args; + + VarStore::MyThis->pc->attach(VarStore::Worker2); + + while(1) { + Thread::wait(10000); + } + +} +/******************************* +* +* +********************************/ char *VarStore::Do(char *str, VarStore* MyThis) {