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.
Fork of YYY_Dragonfly_USBTerminal by
main.cpp@0:46dc3fdbc97e, 2015-02-12 (annotated)
- Committer:
- mfiore
- Date:
- Thu Feb 12 13:40:12 2015 +0000
- Revision:
- 0:46dc3fdbc97e
- Child:
- 1:af87be58749e
initial commit. Terminal application for direct access to radio AT interface
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mfiore | 0:46dc3fdbc97e | 1 | #include "mbed.h" |
| mfiore | 0:46dc3fdbc97e | 2 | |
| mfiore | 0:46dc3fdbc97e | 3 | int main() { |
| mfiore | 0:46dc3fdbc97e | 4 | // external serial port |
| mfiore | 0:46dc3fdbc97e | 5 | Serial ext(PA_2, PA_3); |
| mfiore | 0:46dc3fdbc97e | 6 | // internal serial port to radio |
| mfiore | 0:46dc3fdbc97e | 7 | Serial radio(RADIO_TX, RADIO_RX); |
| mfiore | 0:46dc3fdbc97e | 8 | |
| mfiore | 0:46dc3fdbc97e | 9 | ext.baud(230400); |
| mfiore | 0:46dc3fdbc97e | 10 | radio.baud(115200); |
| mfiore | 0:46dc3fdbc97e | 11 | |
| mfiore | 0:46dc3fdbc97e | 12 | while (true) { |
| mfiore | 0:46dc3fdbc97e | 13 | if (ext.readable()) |
| mfiore | 0:46dc3fdbc97e | 14 | radio.putc(ext.getc()); |
| mfiore | 0:46dc3fdbc97e | 15 | if (radio.readable()) |
| mfiore | 0:46dc3fdbc97e | 16 | ext.putc(radio.getc()); |
| mfiore | 0:46dc3fdbc97e | 17 | } |
| mfiore | 0:46dc3fdbc97e | 18 | } |
