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.
main.cpp@1:8944a6b71daf, 2015-04-29 (annotated)
- Committer:
- mfiore
- Date:
- Wed Apr 29 13:54:36 2015 +0000
- Revision:
- 1:8944a6b71daf
- Parent:
- 0:18ea5db32501
update with latest mbed-src
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mfiore | 0:18ea5db32501 | 1 | #include "mbed.h" |
mfiore | 0:18ea5db32501 | 2 | |
mfiore | 0:18ea5db32501 | 3 | int main() { |
mfiore | 0:18ea5db32501 | 4 | // USB debug port |
mfiore | 0:18ea5db32501 | 5 | Serial usb(USBTX, USBRX); |
mfiore | 0:18ea5db32501 | 6 | // external serial port |
mfiore | 1:8944a6b71daf | 7 | Serial ext(SERIAL_TX, SERIAL_RX); |
mfiore | 0:18ea5db32501 | 8 | |
mfiore | 1:8944a6b71daf | 9 | usb.baud(115200); |
mfiore | 1:8944a6b71daf | 10 | ext.baud(115200); |
mfiore | 0:18ea5db32501 | 11 | |
mfiore | 0:18ea5db32501 | 12 | while (true) { |
mfiore | 0:18ea5db32501 | 13 | if (usb.readable()) |
mfiore | 0:18ea5db32501 | 14 | ext.putc(usb.getc()); |
mfiore | 0:18ea5db32501 | 15 | if (ext.readable()) |
mfiore | 0:18ea5db32501 | 16 | usb.putc(ext.getc()); |
mfiore | 0:18ea5db32501 | 17 | } |
mfiore | 0:18ea5db32501 | 18 | } |