simple passthrough for nucleo
Fork of SerialPassthrough_LPC1768 by
main.cpp
- Committer:
- tulanthoar
- Date:
- 2017-08-03
- Revision:
- 8:1d62862e1390
- Parent:
- 7:564b3a367293
File content as of revision 8:1d62862e1390:
#include "mbed.h" Serial pc(USBTX, USBRX); Serial dev(PD_5,PD_6); DigitalOut led1(LED1); DigitalOut led4(LED2); void dev_recv() { led1 = !led1; while(dev.readable()) { pc.putc(dev.getc()); } } void pc_recv() { led4 = !led4; while(pc.readable()) { dev.putc(pc.getc()); } } int main() { pc.baud(9600); dev.baud(9600); pc.attach(&pc_recv, Serial::RxIrq); dev.attach(&dev_recv, Serial::RxIrq); while(1) { sleep(); } }