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.
Fork of mbed-dev by
Diff: drivers/SerialBase.cpp
- Revision:
- 175:af195413fb11
- Parent:
- 174:b96e65c34a4d
- Child:
- 184:08ed48f1de7f
--- a/drivers/SerialBase.cpp Mon Oct 02 15:33:19 2017 +0100 +++ b/drivers/SerialBase.cpp Wed Oct 11 12:45:49 2017 +0100 @@ -133,6 +133,16 @@ // Stub } +SerialBase::~SerialBase() +{ + // No lock needed in destructor + + // Detaching interrupts releases the sleep lock if it was locked + for (int irq = 0; irq < IrqCnt; irq++) { + attach(NULL, (IrqType)irq); + } +} + #if DEVICE_SERIAL_FC void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) { lock();