UARTSerial needs IRQ cleanup in dtor

29 Sep 2017

OS version known to have issue: 5.5.6

Description

UARTSerial driver not cleaning up enabled ISR on destruction.

Steps to reproduce

Construct and destroy UARTSerial class, then pull RX line line low. IRQ fires causing potential hard fault.

Solution

in UARTSerial.cpp, add SerialBase::attach() calls as follows.

UARTSerial::~UARTSerial()
{
    SerialBase::attach(NULL, RxIrq);
    SerialBase::attach(NULL, TxIrq);
    delete _dcd_irq;
}