Backup and restore vertical scroll offset when goind to sleep/wakeup to avoid scrambled display on wake-up.
This commit is contained in:
		
							parent
							
								
									b279c99488
								
							
						
					
					
						commit
						a91c68c931
					
				@ -132,13 +132,13 @@ void DisplayApp::Refresh() {
 | 
			
		||||
        break;
 | 
			
		||||
      case Messages::ButtonPushed:
 | 
			
		||||
        if(onClockApp)
 | 
			
		||||
          systemTask.PushMessage(System::SystemTask::Messages::GoToSleep);
 | 
			
		||||
        else {
 | 
			
		||||
          auto buttonUsedByApp = currentScreen->OnButtonPushed();
 | 
			
		||||
          if (!buttonUsedByApp) {
 | 
			
		||||
            systemTask.PushMessage(System::SystemTask::Messages::GoToSleep);
 | 
			
		||||
          } else {
 | 
			
		||||
            lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::Up);
 | 
			
		||||
          else {
 | 
			
		||||
            auto buttonUsedByApp = currentScreen->OnButtonPushed();
 | 
			
		||||
            if (!buttonUsedByApp) {
 | 
			
		||||
              systemTask.PushMessage(System::SystemTask::Messages::GoToSleep);
 | 
			
		||||
            } else {
 | 
			
		||||
              lvgl.SetFullRefresh(Components::LittleVgl::FullRefreshDirections::Up);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -31,6 +31,7 @@ namespace Pinetime {
 | 
			
		||||
      private:
 | 
			
		||||
        SpiMaster& spi;
 | 
			
		||||
        uint8_t pinDataCommand;
 | 
			
		||||
        uint8_t verticalScrollingStartAddress = 0;
 | 
			
		||||
 | 
			
		||||
        void HardwareReset();
 | 
			
		||||
        void SoftwareReset();
 | 
			
		||||
 | 
			
		||||
@ -8452,15 +8452,15 @@
 | 
			
		||||
// <e> NRF_LOG_ENABLED - nrf_log - Logger
 | 
			
		||||
//==========================================================
 | 
			
		||||
#ifndef NRF_LOG_ENABLED
 | 
			
		||||
#define NRF_LOG_ENABLED 1
 | 
			
		||||
#define NRF_LOG_ENABLED 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NRF_LOG_BACKEND_RTT_ENABLED
 | 
			
		||||
#define NRF_LOG_BACKEND_RTT_ENABLED 1
 | 
			
		||||
#define NRF_LOG_BACKEND_RTT_ENABLED 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NRF_LOG_BACKEND_SERIAL_USES_RTT
 | 
			
		||||
#define NRF_LOG_BACKEND_SERIAL_USES_RTT 1
 | 
			
		||||
#define NRF_LOG_BACKEND_SERIAL_USES_RTT 0
 | 
			
		||||
#endif
 | 
			
		||||
// <h> Log message pool - Configuration of log message pool
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user