summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/Spi.cpp14
-rw-r--r--src/drivers/Spi.h1
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;
};
}
}