
The simplified Example No.1 on mbed LPC1768.
Diff: main.cpp
- Revision:
- 0:ce210c7aeeb5
diff -r 000000000000 -r ce210c7aeeb5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Feb 05 04:05:36 2017 +0000 @@ -0,0 +1,42 @@ +#include "mbed.h" +#include "microshell.h" +#include "msconf.h" + +Serial pc(USBTX, USBRX); + +static void utx(char c) +{ + pc.putc(c); +} + +static char urx(void) +{ + return pc.getc(); +} + +static void action_hook(MSCORE_ACTION action) +{ +} + +int main(void) +{ + char buf[MSCONF_MAX_INPUT_LENGTH]; + MICROSHELL ms; + + puts( + "\r\n\r\n" + "======================================\r\n" + " MicroShell Simple Example for LPC824 \r\n" + "======================================\r\n" + ); + puts(" Type 'help' for a list of commands.\r\n"); + + microshell_init(&ms, utx, urx, action_hook); + + while (1) { + puts("MicroShell>"); + microshell_getline(&ms, buf, sizeof(buf)); + } + + return 0; +} \ No newline at end of file