Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
include/SerialPrompt.h@3:def8a92db030, 2015-06-24 (annotated)
- Committer:
- overkiller
- Date:
- Wed Jun 24 09:26:07 2015 +0000
- Revision:
- 3:def8a92db030
- Child:
- 4:cc391b3f3e57
Serial prompt stub
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| overkiller | 3:def8a92db030 | 1 | #ifndef SERIALPROMPT_H |
| overkiller | 3:def8a92db030 | 2 | #define SERIALPROMPT_H |
| overkiller | 3:def8a92db030 | 3 | #include "mbed.h" |
| overkiller | 3:def8a92db030 | 4 | const char* prompt = "$>"; |
| overkiller | 3:def8a92db030 | 5 | void displayPrompt(Serial* pcConnection) |
| overkiller | 3:def8a92db030 | 6 | { |
| overkiller | 3:def8a92db030 | 7 | pcConnection->printf(prompt); |
| overkiller | 3:def8a92db030 | 8 | } |
| overkiller | 3:def8a92db030 | 9 | int getInput(Serial* pcConnection) |
| overkiller | 3:def8a92db030 | 10 | { |
| overkiller | 3:def8a92db030 | 11 | if(pcConnection->readable()) |
| overkiller | 3:def8a92db030 | 12 | { |
| overkiller | 3:def8a92db030 | 13 | pcConnection->printf(pcConnection->getc()); |
| overkiller | 3:def8a92db030 | 14 | } |
| overkiller | 3:def8a92db030 | 15 | } |
| overkiller | 3:def8a92db030 | 16 | #endif // SERIALPROMPT_H |