HASwitchPlate / openHASP

HomeAutomation Switchplate based on lvgl for ESP32

Home Page:https://www.openhasp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't select correct backlight pin in Guition ESP32-S3-4848S040 firmware

tdvtdv opened this issue · comments

In the firmware esp32-s3-4848s040_full_16MB_v0.7.0-rc12_cd34d89
it is not possible to select the correct pin.
The wrong pins are offered for selection, and the correct pin 38 cannot be selected
image

In the previous firmware version (0.7.0-rc12 82e4095) there was no such problem
image

Backlight GPIO is set at compile time to GPIO38. If you need to change it, you'll need to edit TFT_BCKL in user_setups/esp32s3/esp32-s3-4848S040.ini

It is clear that you can compile anything, but I wrote about an error in the already created firmware for a particular model, which in fact does not work.

I have the ESP32-S3-4848S040 display myself. The backlight GPIO pin is hardwired in to the board, so there is nothing to set as such. I had submitted a change recently that hid most of the hard wired GPIO (mostly related to TFT control) from the user. See commits c70dfe6 and 7a3b8d0
Perhaps if the backlight GPIO is hard coded, the option to change it should be blanked out so as to avoid confusion.

If you leave the field empty, the brightness control does not work, i.e. everything less than 255 is perceived as 0.

To be more precise, there is probably no direct connection, but firmware esp32-s3-4848s040_full_16MB_v0.7.0-rc12_cd34d89 has exactly this behavior.

Will have to do a build with the latest code (I'm running a two week old build here).
Issuing a backlight("state":"on","brightness":25} dims the backlight as expected. Won't have time to dig any deeper until the weekend.

The backlight pin should be changeable, TFT_BL is treated as a preference instead of being hard-coded. So, this shouldn't be checked here, as it prevents selecting the preferred pin:

#ifdef TFT_BCKL
       || (pin == TFT_BCKL)
#endif

@tdvtdv Does the above commit solve your issue ?

I can't check it yet, because I took a ready-made build from nightly.openhasp.com, and there is an old version there.