Myserial Library extends RawSerial
Diff: MySerial.cpp
- Revision:
- 12:02b3877b48c6
- Parent:
- 11:34ae126807a0
- Child:
- 14:8bd054a87ac5
--- a/MySerial.cpp Thu Jul 03 02:37:41 2014 +0000 +++ b/MySerial.cpp Thu Jul 03 03:19:26 2014 +0000 @@ -1,11 +1,25 @@ #include "MySerial.h" -MySerial::MySerial(PinName tx,PinName rx, char *name):Serial(tx,rx,name) //constructor +MySerial::MySerial(PinName tx,PinName rx):SerialBase(tx,rx) //constructor { fRxStartWait = 0.01; //wait getting a 1st char after interrupted fRxEachWait = 0.001; //wait getting each char } +int MySerial::getc() { + return _base_getc(); +} + +int MySerial::putc(int c) { + return _base_putc(c); +} + +int MySerial::puts(const char *str) { + while (*str) + putc(*str ++); + return 0; +} + void MySerial::SetRxWait(float _fRxStartWait, float _fRxEachWait) { fRxStartWait = _fRxStartWait; //wait getting a 1st char after interrupted