From aa32159c005cf44fbda9fa42818c7deab7c41297 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 22 Apr 2022 23:26:38 +0300 Subject: Tweak gamma on ST7789 and match UI colors This change will increase the color accuracy of the PineTime and make UI development with the simulator easier. --- src/drivers/St7789.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/drivers/St7789.cpp') diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index fd1366f8..d520199e 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -23,6 +23,7 @@ void St7789::Init() { RowAddressSet(); DisplayInversionOn(); NormalModeOn(); + SetGamma(); DisplayOn(); } @@ -114,6 +115,11 @@ void St7789::WriteToRam() { WriteCommand(static_cast(Commands::WriteToRam)); } +void St7789::SetGamma() { + WriteCommand(static_cast(Commands::GammaSet)); + WriteData(0x04); +} + void St7789::DisplayOff() { WriteCommand(static_cast(Commands::DisplayOff)); nrf_delay_ms(500); -- cgit v1.2.3-70-g09d2