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.
uartPassThrough.cpp
- Committer:
- tijl
- Date:
- 2019-05-13
- Revision:
- 1:63664175e603
File content as of revision 1:63664175e603:
#include "mbed.h"
RawSerial pc1(USBTX, USBRX);
RawSerial dev(D1, D0);
DigitalOut CS(D10);
void dev_recv()
{
while(dev.readable()) {
pc1.putc(dev.getc());
}
}
void pc_recv()
{
while(pc1.readable()) {
dev.putc(pc1.getc());
}
}
int mai()
{
CS=1;
pc1.baud(9600);
dev.baud(9600);
while(1) {
pc_recv();
dev_recv();
}
}