From 62848b33fb3df756fea17f31c818cd6de7a85b34 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Thu, 18 May 2023 15:18:56 +0200 Subject: Power optimization - Improve SPI sleep mode Calls to Spi::Init() are not needed, pin initialization is already done in ctor(). Remove calls to Spi::Sleep()/Spi::Wakeup() to ensure that SPI CS pins are kept high even in sleep mode. --- src/drivers/St7789.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/drivers/St7789.cpp') diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index ed98c06d..e18c43a3 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -10,7 +10,6 @@ St7789::St7789(Spi& spi, uint8_t pinDataCommand) : spi {spi}, pinDataCommand {pi } void St7789::Init() { - spi.Init(); nrf_gpio_cfg_output(pinDataCommand); nrf_gpio_cfg_output(26); nrf_gpio_pin_set(26); @@ -188,12 +187,10 @@ void St7789::Sleep() { SleepIn(); nrf_gpio_cfg_default(pinDataCommand); nrf_gpio_cfg_default(26); - spi.Sleep(); NRF_LOG_INFO("[LCD] Sleep"); } void St7789::Wakeup() { - spi.Wakeup(); nrf_gpio_cfg_output(pinDataCommand); SleepOut(); VerticalScrollStartAddress(verticalScrollingStartAddress); -- cgit v1.2.3-70-g09d2