mirror of https://github.com/ARMmbed/mbed-os.git
QSPI: Move destructor into source file
This allows the entire QSPI class to be mocked/faked for unit testing purpose, without dependencies from the real implementation such as `qspi_free()` from the HAL.pull/14989/head
parent
0cb62c4944
commit
e04a16fd9f
|
@ -115,12 +115,7 @@ public:
|
|||
QSPI(const qspi_pinmap_t &pinmap, int mode = 0);
|
||||
QSPI(const qspi_pinmap_t &&, int = 0) = delete; // prevent passing of temporary objects
|
||||
|
||||
virtual ~QSPI()
|
||||
{
|
||||
lock();
|
||||
qspi_free(&_qspi);
|
||||
unlock();
|
||||
}
|
||||
virtual ~QSPI();
|
||||
|
||||
/** Configure the data transmission format
|
||||
*
|
||||
|
|
|
@ -92,6 +92,13 @@ QSPI::QSPI(const qspi_pinmap_t &pinmap, int mode) : _qspi()
|
|||
MBED_ASSERT(success);
|
||||
}
|
||||
|
||||
QSPI::~QSPI()
|
||||
{
|
||||
lock();
|
||||
qspi_free(&_qspi);
|
||||
unlock();
|
||||
}
|
||||
|
||||
qspi_status_t QSPI::configure_format(qspi_bus_width_t inst_width, qspi_bus_width_t address_width, qspi_address_size_t address_size, qspi_bus_width_t alt_width, qspi_alt_size_t alt_size, qspi_bus_width_t data_width, int dummy_cycles)
|
||||
{
|
||||
// Check that alt_size/alt_width are a valid combination
|
||||
|
|
Loading…
Reference in New Issue