Serial passthrough tested on K64

main.cpp

Committer:
MarceloSalazar
Date:
2020-03-31
Revision:
86:bb53196f7557
Parent:
82:abf1b1785bd7

File content as of revision 86:bb53196f7557:

#include "mbed.h"
 
RawSerial pc(USBTX, USBRX, 115200); // tx, rx
RawSerial device(D1, D0, 115200);  // tx, rx
 
int main() {
    while(1) {
        if(pc.readable()) {
            device.putc(pc.getc());
        }
        if(device.readable()) {
            pc.putc(device.getc());
        }
    }
}