lovyan03 / LovyanGFX

SPI LCD graphics library for ESP32 (ESP-IDF/ArduinoESP32) / ESP8266 (ArduinoESP8266) / SAMD51(Seeed ArduinoSAMD51)
Other
1.19k stars 209 forks source link

Arduino Compilation Issue #641

Open brodendan opened 3 days ago

brodendan commented 3 days ago

Carefully written Issues are more likely to be given priority. 丁寧に記述された報告は優先して対応される可能性が高くなります。

Environment ( 実行環境 )

Problem Description ( 問題の内容 )

Unable to compile any Arduino sketch using the LovyanGFX library. Output throws an error related to 'lcd_periph_signals' not being declared in scope (please refer below). I have supplied manufacturer example of Lovyan usage for analysis.

Expected Behavior ( 期待される動作 )

Successful compilation.

Actual Behavior ( 実際の動作 )

Error message relating to 'lcd_periph_signals' declaration as below:

/Users/user/Arduino/libraries/LovyanGFX/src/lgfx/v1/platforms/esp32s3/Bus_RGB.cpp:159:19: error: 'lcd_periph_signals' was not declared in this scope; did you mean 'lcd_periph_rgb_signals'?
  159 |       auto sigs = lcd_periph_signals.panels[_cfg.port];
      |                   ^~~~~~~~~~~~~~~~~~
      |                   lcd_periph_rgb_signals
/Users/user/Arduino/libraries/LovyanGFX/src/lgfx/v1/platforms/esp32s3/Bus_RGB.cpp:307:31: error: 'lcd_periph_signals' was not declared in this scope; did you mean 'lcd_periph_rgb_signals'?
  307 |     esp_intr_alloc_intrstatus(lcd_periph_signals.panels[_cfg.port].irq_id, isr_flags,
      |                               ^~~~~~~~~~~~~~~~~~
      |                               lcd_periph_rgb_signals

The complete output is found here: https://gist.github.com/brodendan/b29762f0bc1aab73dc1f10cf6782509a#file-error-output

Steps to reproduce ( 再現のための前提条件 )

  1. Create Arduino sketch with below source (or copy from https://github.com/Makerfabs/ESP32-S3-Parallel-TFT-with-Touch-7inch/tree/main/example/lovyanGFX/7inch800)
  2. Compile sketch.

// If possible, attach a picture of your setup/wiring here. This is unmodified unit from Makerlabs: https://www.makerfabs.com/esp32-s3-parallel-tft-with-touch-7-inch.html

Code to reproduce this issue ( 再現させるためのコード )

Please refer to: https://gist.github.com/brodendan/b29762f0bc1aab73dc1f10cf6782509a

tobozo commented 13 hours ago

hi,

Please group all feedback in this issue and close the redundant #623, as it is likely the same solution for both arduino IDE and esp-idf.

LovyanGFX neither supports release versions of arduino-core (this excludes beta/alpha/RC) nor esp-idf untagged versions, however it does support lcd_periph_rgb_signals() function, so this is likely a bug that will need to be solved when idf 5.4 becomes officially supported.

Possible cause of the problem: LGFX uses the SOC_LCDCAM_RGB_LCD_SUPPORTED macro (see SoC table) to confirm the presence of lcd_periph_rgb_signals(), but that macro is disabled or out of scope and the test fails when esp-idf version >= 5.1.4.

#if SOC_LCDCAM_RGB_LCD_SUPPORTED // <<<< this test fails
      auto sigs = &lcd_periph_rgb_signals.panels[_cfg.port];
#else
      auto sigs = &lcd_periph_signals.panels[_cfg.port];
#endif

a quick solve for you only (this may break compilation for other devices/versions) is to add this after the includes in esp32s3/Bus_RGB.cpp

#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0))
  #define lcd_periph_signals lcd_periph_rgb_signals
#endif

please confirm the effectiveness of that temporary workaround so I can think of a cleaner way to address the problem :wink: