diff options
| author | Jean-François Milants <jf@codingfield.com> | 2023-05-07 18:24:34 +0200 |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2023-06-04 17:22:27 +0200 |
| commit | 4c0f897953aa8d478f3c941e75d3b2eb5611531d (patch) | |
| tree | 28c926cf8e0319ce5b5369382af6dbf935e17918 /src/drivers/SpiMaster.cpp | |
| parent | 2fa3aaa1617849dd29fe55c844d5250df0cba955 (diff) | |
Power optimization - Improve SPI sleep mode
Ensure that all pins are set to their default configuration during sleep mode.
Disable the workaround for FTPAN58 (SPI freezes when transfering a single byte) at the end of the transfer. This disables the resources needed for the workaround.
Those changes reduce the power usage by 430-490µA.
Diffstat (limited to 'src/drivers/SpiMaster.cpp')
| -rw-r--r-- | src/drivers/SpiMaster.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp index 234884ab..1a2fab9c 100644 --- a/src/drivers/SpiMaster.cpp +++ b/src/drivers/SpiMaster.cpp @@ -204,6 +204,9 @@ bool SpiMaster::Write(uint8_t pinCsn, const uint8_t* data, size_t size) { ; nrf_gpio_pin_set(this->pinCsn); currentBufferAddr = 0; + + DisableWorkaroundForFtpan58(spiBaseAddress, 0, 0); + xSemaphoreGive(mutex); } |
