You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using an M5Stack module with a fairly low backlight setting of 8. I am using deep_sleep and some ULP code to keep the backlight on during sleep.. Whenever the device comes out of deepsleep, I use init_without_reset() which is great to avoid the screen from going blank. However, the screen is initialized with a backlight setting higher than mine which causes the screen to flicker for a split second.
I think I have traced down and avoided the problem. However, my C is not very good. Maybe you can use the code below to trace down the issue and develop a proper fix.
There seem to be two problems:
the panel backlight value is initialized at 128, but lcd.setBacklight() can only be called after init
PanelCommon.init() calls initPWM() without the optional duty parameter and therefore duty=128
I "fixed" 1) with repeating the init code in my own class and setting the panel backlight value after autodetect():
voidWeatherDisplay::init_without_reset(std::uint8_t brightness) {
int retry = 3;
while (!mylcd.autodetect(false) && --retry);
mylcd.getPanel()->brightness = brightness;
//taken from private function mylcd.lgfx::LGFX_SPI<lgfx::LGFX_Config>::init_impl(false);
mylcd.lgfx::LGFX_SPI<lgfx::LGFX_Config>::initBus();
mylcd.lgfx::LGFX_SPI<lgfx::LGFX_Config>::initPanel(false);
mylcd.lgfx::LGFX_SPI<lgfx::LGFX_Config>::initTouch();
// mylcd.init_without_reset();
}
I "fixed" 2) by adding the parameter in PanelCommon.hpp:
Hi,
thanks for this wonderful library!
I am using an M5Stack module with a fairly low backlight setting of 8. I am using deep_sleep and some ULP code to keep the backlight on during sleep.. Whenever the device comes out of deepsleep, I use init_without_reset() which is great to avoid the screen from going blank. However, the screen is initialized with a backlight setting higher than mine which causes the screen to flicker for a split second.
I think I have traced down and avoided the problem. However, my C is not very good. Maybe you can use the code below to trace down the issue and develop a proper fix.
There seem to be two problems:
lcd.setBacklight()
can only be called after initPanelCommon.init()
callsinitPWM()
without the optional duty parameter and therefore duty=128I "fixed" 1) with repeating the init code in my own class and setting the panel backlight value after
autodetect()
:I "fixed" 2) by adding the parameter in
PanelCommon.hpp
:The text was updated successfully, but these errors were encountered: