Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependency on rzeldent/esp32_smartdisplay #8

Open
nGoline opened this issue Nov 18, 2024 · 1 comment
Open

Upgrade dependency on rzeldent/esp32_smartdisplay #8

nGoline opened this issue Nov 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@nGoline
Copy link
Contributor

nGoline commented Nov 18, 2024

We need help upgrading rzeldent/esp32_smartdisplay version to its latest tag, currently @2.1.0.

We must upgrade all direct lgvl calls from our code, including the lv_conf.h file.

We also have to update all designs in UIDesign to use boards v2.0.0 from nGoline/squarelinestudio-boards.

Make sure that we're calling lv_tick_inc on void UIController::run() as in:

// UIController.h
class UIController
{
...
private:
    uint32_t lv_last_tick;
    ...
};
// UIController.cpp
void UIController::run()
{
    ...
    static const uint32_t PROGRESS_DURATION = 5000;

    lv_last_tick = millis();
    
    while (true)
    {
        ...
        // Update ticks
        auto const now = millis();
        lv_tick_inc(now - lv_last_tick);
        lv_last_tick = now;

        // Update the UI
        delayLvgl = lv_timer_handler();
        vTaskDelay(delayLvgl + 1 / portTICK_PERIOD_MS);
    }
}
@andersondeoliveiramachado
Copy link

andersondeoliveiramachado commented Nov 18, 2024

I managed to compile a version for https://github.com/rzeldent/esp32-smartdisplay that uses the LVGL 9.2.2 library, basically what I did was put the lv_conf.h from the project https://github.com/rzeldent/esp32-smartdisplay-demo/blob/main/include/lv_conf.h in place of Cafe21\include\lv_conf.h and modified the image files, which I believe SquareLine Studio Boards create accordingly for LVGL 9.

When generating the qrcode ( UIController.cpp ) , a change in the format is also necessary:

From

`
auto ui_qrcode = lv_qrcode_create(ui_qrCodeContainer, size ? size : QRCODE_INITIAL_SIZE, lv_color_black(), lv_color_white());

`

To

auto ui_qrcode = lv_qrcode_create(ui_qrCodeContainer); lv_qrcode_set_size(ui_qrcode, QRCODE_INITIAL_SIZE); lv_qrcode_set_dark_color(ui_qrcode, lv_color_black()); lv_qrcode_set_light_color(ui_qrcode, lv_color_white());

=============================================================

In the image files I modified it this way:

From:

const lv_img_dsc_t ui_img_check_png = { .header.always_zero = 0, .header.w = 132, .header.h = 132, .data_size = sizeof(ui_img_check_png_data), .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, .data = ui_img_check_png_data};

For :

const lv_img_dsc_t ui_img_check_png = { .header.w = 132, .header.h = 132, .data_size = sizeof(ui_img_check_png_data), .data = ui_img_check_png_data};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants