remove spiMtx (#1907)

This commit is contained in:
Matthew Kennedy 2020-10-25 14:26:46 -07:00 committed by GitHub
parent c64319beec
commit 946fe5091c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -71,8 +71,6 @@ EXTERN_ENGINE;
extern bool hasFirmwareErrorFlag; extern bool hasFirmwareErrorFlag;
static mutex_t spiMtx;
#if HAL_USE_SPI #if HAL_USE_SPI
extern bool isSpiInitialized[5]; extern bool isSpiInitialized[5];
@ -85,14 +83,12 @@ bool rtcWorks = true;
* Only one consumer can use SPI bus at a given time * Only one consumer can use SPI bus at a given time
*/ */
void lockSpi(spi_device_e device) { void lockSpi(spi_device_e device) {
UNUSED(device);
efiAssertVoid(CUSTOM_STACK_SPI, getCurrentRemainingStack() > 128, "lockSpi"); efiAssertVoid(CUSTOM_STACK_SPI, getCurrentRemainingStack() > 128, "lockSpi");
// todo: different locks for different SPI devices! spiAcquireBus(getSpiDevice(device));
chMtxLock(&spiMtx);
} }
void unlockSpi(spi_device_e device) { void unlockSpi(spi_device_e device) {
chMtxUnlock(&spiMtx); spiReleaseBus(getSpiDevice(device));
} }
static void initSpiModules(engine_configuration_s *engineConfiguration) { static void initSpiModules(engine_configuration_s *engineConfiguration) {
@ -451,8 +447,6 @@ void initHardware(Logging *l) {
// 10 extra seconds to re-flash the chip // 10 extra seconds to re-flash the chip
//flashProtect(); //flashProtect();
chMtxObjectInit(&spiMtx);
#if EFI_HISTOGRAMS #if EFI_HISTOGRAMS
/** /**
* histograms is a data structure for CPU monitor, it does not depend on configuration * histograms is a data structure for CPU monitor, it does not depend on configuration