mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: drivers/Serial.cpp
- Revision:
- 187:0387e8f68319
- Parent:
- 160:d5399cc887bb
- Child:
- 189:f392fc9709a3
diff -r 707f6e361f3e -r 0387e8f68319 drivers/Serial.cpp --- a/drivers/Serial.cpp Fri Jun 22 16:45:37 2018 +0100 +++ b/drivers/Serial.cpp Thu Sep 06 13:40:20 2018 +0100 @@ -20,27 +20,33 @@ namespace mbed { -Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase(tx, rx, baud), Stream(name) { +Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase(tx, rx, baud), Stream(name) +{ } -Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL) { +Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL) +{ } -int Serial::_getc() { +int Serial::_getc() +{ // Mutex is already held return _base_getc(); } -int Serial::_putc(int c) { +int Serial::_putc(int c) +{ // Mutex is already held return _base_putc(c); } -void Serial::lock() { +void Serial::lock() +{ _mutex.lock(); } -void Serial::unlock() { +void Serial::unlock() +{ _mutex.unlock(); }