From f841b8c98498a01211036fd0720a1f8c949e28f2 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 19 Oct 2021 19:15:48 +0000 Subject: [PATCH] Revert "More attempted SPI fixes" This reverts commit bed7e731b206961117b717adb1031ab3011e7db9. --- src/drivers/Spi.cpp | 14 -------------- src/drivers/Spi.h | 1 - 2 files changed, 15 deletions(-) diff --git a/src/drivers/Spi.cpp b/src/drivers/Spi.cpp index 46552437..e477622b 100644 --- a/src/drivers/Spi.cpp +++ b/src/drivers/Spi.cpp @@ -10,24 +10,14 @@ Spi::Spi(SpiMaster& spiMaster, uint8_t pinCsn) : spiMaster {spiMaster}, pinCsn { } bool Spi::Write(const uint8_t* data, size_t size) { - if(!active){ - Wakeup(); - } return spiMaster.Write(pinCsn, data, size); } bool Spi::Read(uint8_t* cmd, size_t cmdSize, uint8_t* data, size_t dataSize) { - if(!active){ - Wakeup(); - } return spiMaster.Read(pinCsn, cmd, cmdSize, data, dataSize); } void Spi::Sleep() { - if(!active){ - return; - } - active = false; nrf_gpio_cfg_default(pinCsn); NRF_LOG_INFO("[SPI] Sleep") } @@ -42,11 +32,7 @@ bool Spi::Init() { } void Spi::Wakeup() { - if(active){ - return; - } nrf_gpio_cfg_output(pinCsn); nrf_gpio_pin_set(pinCsn); - active=true; NRF_LOG_INFO("[SPI] Wakeup") } diff --git a/src/drivers/Spi.h b/src/drivers/Spi.h index 51de2b34..9b6a30f4 100644 --- a/src/drivers/Spi.h +++ b/src/drivers/Spi.h @@ -23,7 +23,6 @@ namespace Pinetime { private: SpiMaster& spiMaster; uint8_t pinCsn; - bool active; }; } }