Thomas Cauwelier / Mbed 2 deprecated visible_light_communication

Dependencies:   SoftSerial SDFileSystem mbed wave_player

MySoftSerial.cpp

Committer:
Thomas Cauwelier
Date:
2017-05-10
Revision:
17:8683abdc1912
Parent:
16:1a0589d846bf
Child:
19:822d93e0bf34

File content as of revision 17:8683abdc1912:

//
// Created by thoma on 10-May-17.
//

#include "MySoftSerial.h"
#include "Manchester.h"

MySoftSerial::MySoftSerial(PinName TX, PinName RX, const char *name) : SoftSerial(TX, RX, name) {
    format(16, SoftSerial::None, 1);
}

MySoftSerial::~MySoftSerial() {

}

int MySoftSerial::putc(int c) {
    c = Manchester::encode(c);
    return _putc(c);
}

int MySoftSerial::getc() {
    return Manchester::decode(_getc());
}

void MySoftSerial::prepare_tx(int c) {

    SoftSerial::prepare_tx(c);
}

void MySoftSerial::baud(int baudrate) {
    SoftSerial::baud(baudrate);
}

int MySoftSerial::readable() {
    return SoftSerial::readable();
}

int MySoftSerial::writeable() {
    return SoftSerial::writeable();
}