diff options
author | Tim Keller <geekboy1011@gmail.com> | 2021-10-19 19:15:48 +0000 |
---|---|---|
committer | Tim Keller <geekboy1011@gmail.com> | 2021-12-10 01:18:57 +0000 |
commit | f841b8c98498a01211036fd0720a1f8c949e28f2 (patch) | |
tree | b72a4ea22d7abe5b8c6b5975051423e140eb331b /src/drivers | |
parent | a5a64800eda02358aebe4d0f23d43ee33f363c56 (diff) |
Revert "More attempted SPI fixes"
This reverts commit bed7e731b206961117b717adb1031ab3011e7db9.
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/Spi.cpp | 14 | ||||
-rw-r--r-- | src/drivers/Spi.h | 1 |
2 files changed, 0 insertions, 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; }; } } |