TARGET_NRF: added a description of the recent change in spi_init().

pull/3930/head
Głąbek, Andrzej 2017-03-02 13:47:37 +01:00 committed by Anna Bridge
parent 2129b29bed
commit 4257bfe774
1 changed files with 5 additions and 0 deletions

View File

@ -254,6 +254,11 @@ void spi_init(spi_t *obj,
PinName mosi, PinName miso, PinName sclk, PinName ssel)
{
int i;
// This block is only a workaround that allows to create SPI object several
// times, what would be otherwise impossible in the current implementation
// of mbed driver that does not call spi_free() from SPI destructor.
// Once this mbed's imperfection is corrected, this block should be removed.
for (i = 0; i < SPI_COUNT; ++i) {
spi_info_t *p_spi_info = &m_spi_info[i];
if (p_spi_info->initialized &&