UART analysis program. UART 4 port. for M8Q(GPS)
Fork of FRDM-K64F-UARTCOMMS by
main.cpp@0:f682dcf80f00, 2015-02-23 (annotated)
- Committer:
- andcor02
- Date:
- Mon Feb 23 11:20:37 2015 +0000
- Revision:
- 0:f682dcf80f00
- Child:
- 1:623f51ea713b
//Simple program allowing user to send messages from mbed COM out through UART to another UART COM.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andcor02 | 0:f682dcf80f00 | 1 | #include "mbed.h" |
andcor02 | 0:f682dcf80f00 | 2 | //Simple program allowing user to send messages from mbed COM out through UART to another UART COM. |
andcor02 | 0:f682dcf80f00 | 3 | //Andrea Corrado |
andcor02 | 0:f682dcf80f00 | 4 | Serial pc(USBTX, USBRX); // tx, rx |
andcor02 | 0:f682dcf80f00 | 5 | Serial uart (PTC17, PTC16); |
andcor02 | 0:f682dcf80f00 | 6 | |
andcor02 | 0:f682dcf80f00 | 7 | |
andcor02 | 0:f682dcf80f00 | 8 | int main() |
andcor02 | 0:f682dcf80f00 | 9 | { |
andcor02 | 0:f682dcf80f00 | 10 | while(1) { |
andcor02 | 0:f682dcf80f00 | 11 | if (pc.readable()) { |
andcor02 | 0:f682dcf80f00 | 12 | uart.putc(pc.getc()); |
andcor02 | 0:f682dcf80f00 | 13 | } |
andcor02 | 0:f682dcf80f00 | 14 | } |
andcor02 | 0:f682dcf80f00 | 15 | } |