diff options
author | JF <jf@codingfield.com> | 2020-03-11 21:35:06 +0100 |
---|---|---|
committer | JF <jf@codingfield.com> | 2020-03-11 21:35:06 +0100 |
commit | a91c68c931cc8308e87acd796afb46ba70ae3dc2 (patch) | |
tree | 505f15350e19c44eca19e252ca5b999f959164df /src/drivers | |
parent | b279c994887342197cc5940f1735a074d7e58f1b (diff) |
Backup and restore vertical scroll offset when goind to sleep/wakeup to avoid scrambled display on wake-up.
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/St7789.cpp | 2 | ||||
-rw-r--r-- | src/drivers/St7789.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 1f6e6d36..db7c27e2 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -131,6 +131,7 @@ void St7789::VerticalScrollDefinition(uint16_t topFixedLines, uint16_t scrollLin } void St7789::VerticalScrollStartAddress(uint16_t line) { + verticalScrollingStartAddress = line; WriteCommand(static_cast<uint8_t>(Commands::VerticalScrollStartAddress)); WriteData(line >> 8u); WriteData(line & 0x00ffu); @@ -189,5 +190,6 @@ void St7789::Wakeup() { RowAddressSet(); DisplayInversionOn(); NormalModeOn(); + VerticalScrollStartAddress(verticalScrollingStartAddress); DisplayOn(); } diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index fb57f283..3721b184 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -31,6 +31,7 @@ namespace Pinetime { private: SpiMaster& spi; uint8_t pinDataCommand; + uint8_t verticalScrollingStartAddress = 0; void HardwareReset(); void SoftwareReset(); |