diff --git a/api/cpp/esp-idf/slint/README.md b/api/cpp/esp-idf/slint/README.md index fd2ce691d21..164ac131340 100644 --- a/api/cpp/esp-idf/slint/README.md +++ b/api/cpp/esp-idf/slint/README.md @@ -86,8 +86,8 @@ extern "C" void app_main(void) /* Initialize Slint's ESP platform support*/ slint_esp_init(SlintPlatformConfiguration { .size = slint::PhysicalSize({ BSP_LCD_H_RES, BSP_LCD_V_RES }), - .panel = panel_handle, - .touch = touch_handle, + .panel_handle = panel_handle, + .touch_handle = touch_handle, .buffer1 = buffer, .color_swap_16 = true }); diff --git a/api/cpp/esp-idf/slint/include/slint-esp.h b/api/cpp/esp-idf/slint/include/slint-esp.h index 182d0271a94..cc38751e4bd 100644 --- a/api/cpp/esp-idf/slint/include/slint-esp.h +++ b/api/cpp/esp-idf/slint/include/slint-esp.h @@ -37,10 +37,11 @@ struct SlintPlatformConfiguration /// The size of the screen in pixels. slint::PhysicalSize size; /// The handle to the display as previously initialized by `bsp_display_new` or - /// `esp_lcd_panel_init`. - esp_lcd_panel_handle_t panel = nullptr; - /// The touch screen handle, if the device is equipped with a touch screen. - esp_lcd_touch_handle_t touch = nullptr; + /// `esp_lcd_panel_init`. Must be set to a valid, non-null esp_lcd_panel_handle_t. + esp_lcd_panel_handle_t panel_handle = nullptr; + /// The touch screen handle, if the device is equipped with a touch screen. Set to nullptr + /// otherwise; + esp_lcd_touch_handle_t touch_handle = nullptr; /// The buffer Slint will render into. It must have have the size of at least one frame. Slint /// calls esp_lcd_panel_draw_bitmap to flush the buffer to the screen. std::optional> buffer1 = {}; diff --git a/api/cpp/esp-idf/slint/src/slint-esp.cpp b/api/cpp/esp-idf/slint/src/slint-esp.cpp index 18150461594..5ff9b085e03 100644 --- a/api/cpp/esp-idf/slint/src/slint-esp.cpp +++ b/api/cpp/esp-idf/slint/src/slint-esp.cpp @@ -22,8 +22,8 @@ struct EspPlatform : public slint::platform::Platform { EspPlatform(const SlintPlatformConfiguration &config) : size(config.size), - panel_handle(config.panel), - touch_handle(config.touch), + panel_handle(config.panel_handle), + touch_handle(config.touch_handle), buffer1(config.buffer1), buffer2(config.buffer2), color_swap_16(config.color_swap_16), @@ -327,8 +327,8 @@ void slint_esp_init(slint::PhysicalSize size, esp_lcd_panel_handle_t panel, SlintPlatformConfiguration config { .size = size, - .panel = panel, - .touch = touch ? *touch : nullptr, + .panel_handle = panel, + .touch_handle = touch ? *touch : nullptr, .buffer1 = buffer1, .buffer2 = buffer2, // For compatibility with earlier versions of Slint, we compute the value of @@ -344,8 +344,8 @@ void slint_esp_init(slint::PhysicalSize size, esp_lcd_panel_handle_t panel, slint::platform::SoftwareRenderer::RenderingRotation rotation) { SlintPlatformConfiguration config { .size = size, - .panel = panel, - .touch = touch ? *touch : nullptr, + .panel_handle = panel, + .touch_handle = touch ? *touch : nullptr, .buffer1 = std::nullopt, .buffer2 = std::nullopt, .rotation = rotation, diff --git a/examples/carousel/esp-idf/main.cpp b/examples/carousel/esp-idf/main.cpp index 31c737f3d03..fe14dd4701c 100644 --- a/examples/carousel/esp-idf/main.cpp +++ b/examples/carousel/esp-idf/main.cpp @@ -51,8 +51,8 @@ extern "C" void app_main(void) slint_esp_init(SlintPlatformConfiguration { .size = slint::PhysicalSize({ BSP_LCD_H_RES, BSP_LCD_V_RES }), - .panel = panel_handle, - .touch = touch_handle, + .panel_handle = panel_handle, + .touch_handle = touch_handle, .buffer1 = buffer, .color_swap_16 = true }); diff --git a/examples/printerdemo_mcu/esp-idf/main/main.cpp b/examples/printerdemo_mcu/esp-idf/main/main.cpp index 0faf60c2b51..3c7baad5bbf 100644 --- a/examples/printerdemo_mcu/esp-idf/main/main.cpp +++ b/examples/printerdemo_mcu/esp-idf/main/main.cpp @@ -53,8 +53,8 @@ extern "C" void app_main(void) slint_esp_init(SlintPlatformConfiguration { .size = slint::PhysicalSize({ BSP_LCD_H_RES, BSP_LCD_V_RES }), - .panel = panel_handle, - .touch = touch_handle, + .panel_handle = panel_handle, + .touch_handle = touch_handle, .buffer1 = buffer, .color_swap_16 = true });