From faed0d49006605e33905f1914f04c90f6138bf6e Mon Sep 17 00:00:00 2001 From: hubmartin Date: Sun, 15 Aug 2021 16:47:41 +0200 Subject: [PATCH 1/3] Remove unnecessary pin_set, save 50ms --- src/drivers/Cst816s.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index fd9792b3..affc432f 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -19,8 +19,8 @@ Cst816S::Cst816S(TwiMaster& twiMaster, uint8_t twiAddress) : twiMaster {twiMaste void Cst816S::Init() { nrf_gpio_cfg_output(pinReset); - nrf_gpio_pin_set(pinReset); - vTaskDelay(50); + //nrf_gpio_pin_set(pinReset); + //vTaskDelay(5); nrf_gpio_pin_clear(pinReset); vTaskDelay(5); nrf_gpio_pin_set(pinReset); From 099364e619374c4ad9bc0ba9136c31c35a82faf7 Mon Sep 17 00:00:00 2001 From: hubmartin Date: Sun, 15 Aug 2021 16:48:41 +0200 Subject: [PATCH 2/3] Remove LCD reset and more cmds, save over 200ms --- src/drivers/St7789.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 0f1dc02e..74038b2b 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -171,15 +171,15 @@ void St7789::Sleep() { void St7789::Wakeup() { nrf_gpio_cfg_output(pinDataCommand); // TODO why do we need to reset the controller? - HardwareReset(); - SoftwareReset(); + //HardwareReset(); + //SoftwareReset(); SleepOut(); - ColMod(); - MemoryDataAccessControl(); - ColumnAddressSet(); - RowAddressSet(); - DisplayInversionOn(); - NormalModeOn(); + //ColMod(); + //MemoryDataAccessControl(); + //ColumnAddressSet(); + //RowAddressSet(); + //DisplayInversionOn(); + //NormalModeOn(); VerticalScrollStartAddress(verticalScrollingStartAddress); DisplayOn(); NRF_LOG_INFO("[LCD] Wakeup") From db50131ed49f2fdb639799ca12839862340f8396 Mon Sep 17 00:00:00 2001 From: hubmartin Date: Mon, 23 Aug 2021 15:02:40 +0200 Subject: [PATCH 3/3] Remove commented commands completely --- src/drivers/Cst816s.cpp | 2 -- src/drivers/St7789.cpp | 9 --------- 2 files changed, 11 deletions(-) diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index affc432f..2e70a469 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -19,8 +19,6 @@ Cst816S::Cst816S(TwiMaster& twiMaster, uint8_t twiAddress) : twiMaster {twiMaste void Cst816S::Init() { nrf_gpio_cfg_output(pinReset); - //nrf_gpio_pin_set(pinReset); - //vTaskDelay(5); nrf_gpio_pin_clear(pinReset); vTaskDelay(5); nrf_gpio_pin_set(pinReset); diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 74038b2b..4d81cf27 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -170,16 +170,7 @@ void St7789::Sleep() { void St7789::Wakeup() { nrf_gpio_cfg_output(pinDataCommand); - // TODO why do we need to reset the controller? - //HardwareReset(); - //SoftwareReset(); SleepOut(); - //ColMod(); - //MemoryDataAccessControl(); - //ColumnAddressSet(); - //RowAddressSet(); - //DisplayInversionOn(); - //NormalModeOn(); VerticalScrollStartAddress(verticalScrollingStartAddress); DisplayOn(); NRF_LOG_INFO("[LCD] Wakeup")