port http://sourceforge.net/projects/tinysh to mbed enviroment
Dependents: kl25z-tinyshell-demo HelloWorld_IHM02A1
This library is a port of tiny shell library to mbed enviroment.
Features
- Autocomplete
- Command history
- Linux like
Tiny Shell minimal example
#include "mbed.h" #include "tinysh.h" //serial port to use Serial pc(USBTX, USBRX); //custom function void foo_fnt(int argc, char **argv) { printf("foo command called\r\n"); for(int i=0; i<argc; i++) { printf("argv[%d]=\"%s\"\r\n",i,argv[i]); } } //custom command tinysh_cmd_t myfoocmd= {0,"foo","foo command","[args]",foo_fnt,0,0,0}; //mandatory tiny shell output function void tinysh_char_out(unsigned char c) { pc.putc(c); } void main(void){ //configure serial baudrate pc.baud(115200); //print build date pc.printf("tiny shell build %s %s\r\n",__DATE__,__TIME__); //set prompt tinysh_set_prompt("$ "); //add custom commands here tinysh_add_command(&myfoocmd); //run command parser loop foverer while(true) { tinysh_char_in( pc.getc() ); } }
History
update \r e \n
2014-03-11, by murilopontes [Tue, 11 Mar 2014 05:19:36 +0000] rev 1
update \r e \n
tiny shell port
2014-03-11, by murilopontes [Tue, 11 Mar 2014 03:49:18 +0000] rev 0
tiny shell port