Skip to content

A couple of code errors in ESP_PanellLcd.cpp #130

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

Closed
Tracked by #137
mhavill opened this issue Nov 28, 2024 · 2 comments
Closed
Tracked by #137

A couple of code errors in ESP_PanellLcd.cpp #130

mhavill opened this issue Nov 28, 2024 · 2 comments
Labels
Bug Something isn't working Platform: ESP-IDF

Comments

@mhavill
Copy link

mhavill commented Nov 28, 2024

I accidentally found the following two errors in the coding of /esp-arduino-libs/ESP32_Display_Panel/blob/master/src/lcd/ESP_PanelLcd.cpp lines 447 onward when I missed setting CONFIG_SPIRAM_RODATA true.

    /* Check the callback function and user data placement */
    // For RGB LCD, if the "XIP on PSRAM" function is not enabled, the callback function and user data should be
    // placed in SRAM
#if (SOC_MIPI_DSI_SUPPORTED && CONFIG_LCD_DSI_ISR_IRAM_SAFE) || \
    (SOC_LCD_RGB_SUPPORTED && CONFIG_LCD_RGB_ISR_IRAM_SAFE && !(CONFIG_SPIRAM_RODATA && CONFIG_SPIRAM_FETCH_INSTRUCTIONS))
    if (bus->getType() == ESP_PANEL_BUS_TYPE_RGB || bus->getType() == ESP_PANEL_BUS_TYPE_MIPI_DSI) {
        ESP_PANEL_CHECK_FALSE_RET(
            esp_ptr_in_iram(callback), false,
            "Callback function should be placed in IRAM, add `IRAM_ATTR` before the function"
        );
        ESP_PANEL_CHECK_FALSE_RET((esp_ptr_internal(user_data), false, "User data should be placed in SRAM"));
    }
#endif
  1. on the line
        ESP_PANEL_CHECK_FALSE_RET( esp_ptr_in_iram(callback), false, "Callback function should be placed in IRAM, add `IRAM_ATTR` before the function"   );

Gives the error cannot convert 'std::function<bool(void*)>' to 'const void*' against callback

  1. the line
        ESP_PANEL_CHECK_FALSE_RET((esp_ptr_internal(user_data), false, "User data should be placed in SRAM"));

Has an extra pair of brackets so it is reported as a single argument when 4 are required. Should be

        ESP_PANEL_CHECK_FALSE_RET(esp_ptr_internal(user_data), false, "User data should be placed in SRAM");
@Lzw655
Copy link
Collaborator

Lzw655 commented Nov 28, 2024

Hi @mhavill, thank you very much for pointing out this issue! I will fix it in the next version.

BTW, are you using it based on ESP-IDF? Because the issue will only be triggered when enabling CONFIG_LCD_DSI_ISR_IRAM_SAFE or CONFIG_LCD_RGB_ISR_IRAM_SAFE .

@mhavill
Copy link
Author

mhavill commented Nov 28, 2024

Hi.
I am using it on ESP-IDF for a Waveshare ESP32-S3-LCD-Touch-4.3 with LVGL v9
Thank you for your work!

@Lzw655 Lzw655 added Bug Something isn't working Platform: ESP-IDF labels Nov 28, 2024
@Lzw655 Lzw655 mentioned this issue Dec 13, 2024
10 tasks
Lzw655 added a commit that referenced this issue Feb 17, 2025
Closes #108
Closes #130
Closes #131
Closes #138
Closes #150
Closes #155
@Lzw655 Lzw655 closed this as completed in 8861c38 Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Platform: ESP-IDF
Projects
None yet
Development

No branches or pull requests

2 participants