Shinichiro Nakamura
/
MicroShellExample
The simplified Example No.1 on mbed LPC1768.
Revision 0:ce210c7aeeb5, committed 2017-02-05
- Comitter:
- shintamainjp
- Date:
- Sun Feb 05 04:05:36 2017 +0000
- Commit message:
- The first commitment.
Changed in this revision
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Feb 05 04:05:36 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/176b8275d35d \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/microshell.lib Sun Feb 05 04:05:36 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/shintamainjp/code/MicroShell/#e91b984e285d