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.
Dependents: MbedSmartRestMain MbedSmartRestMain
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)
