Add a bunch of APNs
Fork of C027_Support by
Diff: SerialPipe.cpp
- Revision:
- 74:208e3e32d263
- Parent:
- 70:0a87d256cd24
- Child:
- 75:ce6e12067d0c
--- a/SerialPipe.cpp Thu May 15 08:25:45 2014 +0000 +++ b/SerialPipe.cpp Thu May 15 22:20:42 2014 +0000 @@ -2,10 +2,13 @@ #include "SerialPipe.h" -SerialPipe::SerialPipe(PinName tx, PinName rx, int rxSize, int txSize) - : _SerialPipeBase(tx,rx), _pipeRx(rxSize), _pipeTx(txSize) +SerialPipe::SerialPipe(PinName tx, PinName rx, int rxSize, int txSize) : + _SerialPipeBase(tx,rx), + _pipeRx( (rx!=NC) ? rxSize : 0), + _pipeTx( (tx!=NC) ? txSize : 0) { - attach(this, &SerialPipe::rxIrqBuf, RxIrq); + if (rx!=NC) + attach(this, &SerialPipe::rxIrqBuf, RxIrq); } SerialPipe::~SerialPipe(void)