Merge pull request #10480 from kjbracey-arm/spi_prime

SPI: Prime asynch transaction buffer on construction
pull/10594/head
Martin Kojtal 2019-05-14 09:28:41 +01:00 committed by GitHub
commit 64575fe586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -83,6 +83,12 @@ void SPI::_do_construct()
_peripheral->name = name;
}
core_util_critical_section_exit();
#if DEVICE_SPI_ASYNCH && TRANSACTION_QUEUE_SIZE_SPI
// prime the SingletonPtr, so we don't have a problem trying to
// construct the buffer if asynch operation initiated from IRQ
_peripheral->transaction_buffer.get();
#endif
// we don't need to _acquire at this stage.
// this will be done anyway before any operation.
}