Skip to content

Commit 875ca07

Browse files
committed
esp-idf: Fix vsync locking
1 parent 2d944b2 commit 875ca07

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

api/cpp/esp-idf/slint/src/slint-esp.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ void EspPlatform::run_event_loop()
213213
|| rotation
214214
== slint::platform::SoftwareRenderer::RenderingRotation::Rotate270;
215215
if (buffer1) {
216+
#if SOC_LCD_RGB_SUPPORTED && ESP_IDF_VERSION_MAJOR >= 5
217+
if (buffer2) {
218+
xSemaphoreGive(sem_gui_ready);
219+
xSemaphoreTake(sem_vsync_end, portMAX_DELAY);
220+
}
221+
#endif
216222
auto region = m_window->m_renderer.render(buffer1.value(),
217223
rotated ? size.height : size.width);
218224

@@ -232,11 +238,6 @@ void EspPlatform::run_event_loop()
232238
if (buffer2) {
233239
auto s = region.bounding_box_size();
234240
if (s.width > 0 && s.height > 0) {
235-
#if SOC_LCD_RGB_SUPPORTED && ESP_IDF_VERSION_MAJOR >= 5
236-
xSemaphoreGive(sem_gui_ready);
237-
xSemaphoreTake(sem_vsync_end, portMAX_DELAY);
238-
#endif
239-
240241
// Assuming that using double buffer means that the buffer comes from
241242
// the driver and we need to pass the exact pointer.
242243
// https://github.com/espressif/esp-idf/blob/53ff7d43dbff642d831a937b066ea0735a6aca24/components/esp_lcd/src/esp_lcd_panel_rgb.c#L681

0 commit comments

Comments
 (0)