Corentin Potron / SerialHalfDuplex

Fork of SerialHalfDuplex by mbed unsupported

SerialHalfDuplex.cpp

Committer:
cpotron
Date:
2018-04-25
Revision:
2:242a54f3629b
Parent:
1:7ce196329ced

File content as of revision 2:242a54f3629b:

#include "SerialHalfDuplex.h"

SerialHalfDuplex::SerialHalfDuplex(PinName tx, PinName rx) : out(tx, NC, 1000000), in(NC, rx, 1000000) {
    
}

int SerialHalfDuplex::putc(int byte) {
    out.putc(byte);
    while(in.readable()) {
        in.getc();
    }
}

int SerialHalfDuplex::getc() {
    return 0;
}