Display related fixes

- CHange Display removed PWM control of backlight GPIO for universal display regression from v14.1.0
- Fix Display DisplayMode adds a display device while not configured
- Fix GUI intermittent exception on screen updates due to flash access
This commit is contained in:
Theo Arends 2024-12-15 00:32:51 +01:00
parent 615c6763f6
commit b3b9699782
5 changed files with 52 additions and 37 deletions

View File

@ -6,18 +6,21 @@ All notable changes to this project will be documented in this file.
## [14.4.0.1] ## [14.4.0.1]
### Added ### Added
- MCP23XXX_DRV control register IOCON in template (#22622) - MCP23XXX_DRV control register IOCON in template (#22622)
- TLS add support for ECDSA on ESP32 - ESP32 support for TLS ECDSA (#22649)
### Breaking Changed ### Breaking Changed
### Changed ### Changed
- Berry make Leds animate calls reentrant (#22643) - Berry make Leds animate calls reentrant (#22643)
- SSL clean up remnants of old fingerprint algorithm (#22645) - SSL clean up remnants of old fingerprint algorithm (#22645)
- Display removed PWM control of backlight GPIO for universal display regression from v14.1.0
### Fixed ### Fixed
- ESP32 rules operation priority regression from v13.3.0.4 (#22636) - ESP32 rules operation priority regression from v13.3.0.4 (#22636)
- GUI display power button regression from v14.3.0.5 (#15788) - GUI display power button regression from v14.3.0.5 (#15788)
- MCP23xxx, PCF8574 and Shift595 power control when a display is configured regression from v14.3.0.7 - MCP23xxx, PCF8574 and Shift595 power control when a display is configured regression from v14.3.0.7
- Display DisplayMode adds a display device while not configured
- GUI intermittent exception on screen updates due to flash access
### Removed ### Removed

View File

@ -117,14 +117,17 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
## Changelog v14.4.0.1 ## Changelog v14.4.0.1
### Added ### Added
- MCP23XXX_DRV control register IOCON in template [#22622](https://github.com/arendst/Tasmota/issues/22622) - MCP23XXX_DRV control register IOCON in template [#22622](https://github.com/arendst/Tasmota/issues/22622)
- ESP32 support for TLS ECDSA [#22649](https://github.com/arendst/Tasmota/issues/22649)
### Breaking Changed ### Breaking Changed
### Changed ### Changed
- Display removed PWM control of backlight GPIO for universal display regression from v14.1.0
- SSL clean up remnants of old fingerprint algorithm [#22645](https://github.com/arendst/Tasmota/issues/22645)
- Berry make Leds animate calls reentrant [#22643](https://github.com/arendst/Tasmota/issues/22643) - Berry make Leds animate calls reentrant [#22643](https://github.com/arendst/Tasmota/issues/22643)
- SSL clean up remnants of old fingerprint algorithm (#22645)[#22645](https://github.com/arendst/Tasmota/issues/22645)
### Fixed ### Fixed
- Display DisplayMode adds a display device while not configured
- GUI display power button regression from v14.3.0.5 [#15788](https://github.com/arendst/Tasmota/issues/15788) - GUI display power button regression from v14.3.0.5 [#15788](https://github.com/arendst/Tasmota/issues/15788)
- MCP23xxx, PCF8574 and Shift595 power control when a display is configured regression from v14.3.0.7 - MCP23xxx, PCF8574 and Shift595 power control when a display is configured regression from v14.3.0.7
- ESP32 rules operation priority regression from v13.3.0.4 [#22636](https://github.com/arendst/Tasmota/issues/22636) - ESP32 rules operation priority regression from v13.3.0.4 [#22636](https://github.com/arendst/Tasmota/issues/22636)

View File

@ -835,6 +835,9 @@ int32_t UpdateDevicesPresent(int32_t change) {
// AddLog(LOG_LEVEL_DEBUG, PSTR("APP: Max 32 devices supported")); // AddLog(LOG_LEVEL_DEBUG, PSTR("APP: Max 32 devices supported"));
} }
TasmotaGlobal.devices_present = devices_present; TasmotaGlobal.devices_present = devices_present;
// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("DVC: DevicesPresent %d, Change %d"), TasmotaGlobal.devices_present, change);
return difference; return difference;
} }

View File

@ -1289,7 +1289,7 @@ void WebGetDeviceCounts(void) {
} }
#endif // USE_SHUTTER #endif // USE_SHUTTER
// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("HTP: DP %d, BNLNS %d, SB %08X"), TasmotaGlobal.devices_present, Web.buttons_non_light_non_shutter, Web.light_shutter_button_mask); // AddLog(LOG_LEVEL_DEBUG, PSTR("HTP: DP %d, BNLNS %d, SB %08X"), TasmotaGlobal.devices_present, Web.buttons_non_light_non_shutter, Web.light_shutter_button_mask);
} }
#ifdef USE_LIGHT #ifdef USE_LIGHT
@ -1374,7 +1374,6 @@ void HandleRoot(void) {
if (TasmotaGlobal.devices_present) { if (TasmotaGlobal.devices_present) {
WebGetDeviceCounts(); WebGetDeviceCounts();
uint32_t button_idx = 1;
if (Web.buttons_non_light_non_shutter) { // Any non light AND non shutter button - Show toggle buttons if (Web.buttons_non_light_non_shutter) { // Any non light AND non shutter button - Show toggle buttons
WSContentSend_P(HTTP_TABLE100); // "<table style='width:100%%'>" WSContentSend_P(HTTP_TABLE100); // "<table style='width:100%%'>"
WSContentSend_P(PSTR("<tr>")); WSContentSend_P(PSTR("<tr>"));
@ -1400,7 +1399,7 @@ void HandleRoot(void) {
if (Web.buttons_non_light_non_shutter % rows) { cols++; } if (Web.buttons_non_light_non_shutter % rows) { cols++; }
uint32_t button_ptr = 0; uint32_t button_ptr = 0;
for (button_idx = 1; button_idx <= TasmotaGlobal.devices_present; button_idx++) { for (uint32_t button_idx = 1; button_idx <= TasmotaGlobal.devices_present; button_idx++) {
if (bitRead(Web.light_shutter_button_mask, button_idx -1)) { continue; } // Skip non-sequential light and/or shutter button if (bitRead(Web.light_shutter_button_mask, button_idx -1)) { continue; } // Skip non-sequential light and/or shutter button
bool set_button = ((button_idx <= MAX_BUTTON_TEXT) && strlen(GetWebButton(button_idx -1))); bool set_button = ((button_idx <= MAX_BUTTON_TEXT) && strlen(GetWebButton(button_idx -1)));
snprintf_P(stemp, sizeof(stemp), PSTR(" %d"), button_idx); snprintf_P(stemp, sizeof(stemp), PSTR(" %d"), button_idx);
@ -1457,7 +1456,7 @@ void HandleRoot(void) {
if (TasmotaGlobal.light_type) { // Any light - Show light button and slider(s) if (TasmotaGlobal.light_type) { // Any light - Show light button and slider(s)
uint32_t light_device = LightDevice(); uint32_t light_device = LightDevice();
uint32_t light_devices = LightDevices(); uint32_t light_devices = LightDevices();
button_idx = light_device; uint32_t button_idx = light_device;
WSContentSend_P(HTTP_TABLE100); // "<table style='width:100%%'>" WSContentSend_P(HTTP_TABLE100); // "<table style='width:100%%'>"
@ -1904,11 +1903,14 @@ bool HandleRootStatusRefresh(void) {
WSContentSend_P(PSTR("{t}<tr>")); WSContentSend_P(PSTR("{t}<tr>"));
uint32_t cols = Web.buttons_non_light_non_shutter; uint32_t cols = Web.buttons_non_light_non_shutter;
uint32_t fontsize = (cols < 5) ? 70 - (cols * 8) : 32; uint32_t fontsize = (cols < 5) ? 70 - (cols * 8) : 32;
for (uint32_t idx = 1; idx <= Web.buttons_non_light_non_shutter; idx++) { uint32_t button_ptr = 0;
if (bitRead(Web.light_shutter_button_mask, idx -1)) { continue; } // Skip non-sequential shutter button for (uint32_t button_idx = 1; button_idx <= TasmotaGlobal.devices_present; button_idx++) {
snprintf_P(svalue, sizeof(svalue), PSTR("%d"), bitRead(TasmotaGlobal.power, idx -1)); if (bitRead(Web.light_shutter_button_mask, button_idx -1)) { continue; } // Skip non-sequential shutter button
WSContentSend_P(HTTP_DEVICE_STATE, 100 / cols, (bitRead(TasmotaGlobal.power, idx -1)) ? PSTR("bold") : PSTR("normal"), fontsize, bool power_state = bitRead(TasmotaGlobal.power, button_idx -1);
(cols < 5) ? GetStateText(bitRead(TasmotaGlobal.power, idx -1)) : svalue); snprintf_P(svalue, sizeof(svalue), PSTR("%d"), power_state);
WSContentSend_P(HTTP_DEVICE_STATE, 100 / cols, (power_state) ? "bold" : "normal", fontsize, (cols < 5) ? GetStateText(power_state) : svalue);
button_ptr++;
if (button_ptr == Web.buttons_non_light_non_shutter) { break; }
} }
WSContentSend_P(PSTR("</tr></table>")); WSContentSend_P(PSTR("</tr></table>"));
} }

View File

@ -1852,57 +1852,61 @@ void DisplayLocalSensor(void)
\*********************************************************************************************/ \*********************************************************************************************/
void DisplayInitDriver(void) { void DisplayInitDriver(void) {
Settings->display_model = 0;
XdspCall(FUNC_DISPLAY_INIT_DRIVER); XdspCall(FUNC_DISPLAY_INIT_DRIVER);
// AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "Display model %d"), Settings->display_model); // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "Display model %d"), Settings->display_model);
if (Settings->display_model) { if (!Settings->display_model) { return; }
// ApplyDisplayDimmer(); // Not allowed here. Way too early in init sequence. Global power state has not been set at this point in time
// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("DSP: Model %d"), Settings->display_model);
// ApplyDisplayDimmer(); // Not allowed here. Way too early in init sequence. Global power state has not been set at this point in time
#ifdef USE_MULTI_DISPLAY #ifdef USE_MULTI_DISPLAY
Set_display(0); Set_display(0);
#endif // USE_MULTI_DISPLAY #endif // USE_MULTI_DISPLAY
if (renderer) { if (renderer) {
renderer->setTextFont(Settings->display_font); renderer->setTextFont(Settings->display_font);
renderer->setTextSize(Settings->display_size); renderer->setTextSize(Settings->display_size);
// force opaque mode // force opaque mode
renderer->setDrawMode(0); renderer->setDrawMode(0);
for (uint32_t cnt = 0; cnt < (MAX_INDEXCOLORS - PREDEF_INDEXCOLORS); cnt++) { for (uint32_t cnt = 0; cnt < (MAX_INDEXCOLORS - PREDEF_INDEXCOLORS); cnt++) {
index_colors[cnt] = 0; index_colors[cnt] = 0;
}
} }
}
#ifdef USE_DT_VARS #ifdef USE_DT_VARS
free_dt_vars(); free_dt_vars();
#endif #endif
#ifdef USE_UFILESYS #ifdef USE_UFILESYS
Display_Text_From_File(DISP_BATCH_FILE); Display_Text_From_File(DISP_BATCH_FILE);
#endif #endif
#ifdef USE_GRAPH #ifdef USE_GRAPH
for (uint8_t count = 0; count < NUM_GRAPHS; count++) { graph[count] = 0; } for (uint8_t count = 0; count < NUM_GRAPHS; count++) { graph[count] = 0; }
#endif #endif
UpdateDevicesPresent(1); UpdateDevicesPresent(1);
if (!PinUsed(GPIO_BACKLIGHT)) { if (!PinUsed(GPIO_BACKLIGHT)) {
if ((LT_PWM1 == TasmotaGlobal.light_type) && // Single PWM light channel if ((LT_PWM1 == TasmotaGlobal.light_type) && // Single PWM light channel
((4 == Settings->display_model) || // ILI9341 legacy (4 == Settings->display_model) // ILI9341 legacy
(17 == Settings->display_model)) // Universal // ((4 == Settings->display_model) || // ILI9341 legacy
) { // (17 == Settings->display_model)) // Universal - Too invasive in case displays have no backlight pin
UpdateDevicesPresent(-1); // Assume PWM channel is used for backlight ) {
} UpdateDevicesPresent(-1); // Assume PWM channel is used for backlight
} }
disp_device = TasmotaGlobal.devices_present; }
disp_device = TasmotaGlobal.devices_present;
#ifndef USE_DISPLAY_MODES1TO5 #ifndef USE_DISPLAY_MODES1TO5
Settings->display_mode = 0; Settings->display_mode = 0;
#else #else
DisplayLogBufferInit(); DisplayLogBufferInit();
#endif // USE_DISPLAY_MODES1TO5 #endif // USE_DISPLAY_MODES1TO5
}
} }
void DisplaySetPower(void) { void DisplaySetPower(void) {