lovyan03 / LovyanGFX

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

Error compiling with PlatformIO and Arduino+RP2040 #356

Closed PhilippMolitor closed 1 year ago

PhilippMolitor commented 1 year ago

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

Environment ( 実行環境 )

platformio.ini:

[env]
platform = raspberrypi
board = pico
framework = arduino

Problem Description ( 問題の内容 )

I get this error when compiling:

.pio/libdeps/debug/LovyanGFX/src/lgfx/v1/platforms/rp2040/Light_PWM.cpp:25:10: fatal error: pico/stdio.h: No such file or directory
   25 | #include <pico/stdio.h>
      |          ^~~~~~~~~~~~~~

It seems to include from the pico headers, but it is supposed to use the Arduino libraries instead.

Expected Behavior ( 期待される動作 )

Compilation should succeed without errors.

Actual Behavior ( 実際の動作 )

As stated above

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

See this repository: https://github.com/PhilippMolitor/waveshare-rp2040-roundlcd-boilerplate

The configuration of LovyanGFC happens in lib/display/display.h

tobozo commented 1 year ago

hi, thanks for your feedback :+1:

Only earlephilhower/arduino-pico core is supported.

Please check the platform readme, some modifications are required in your ini file:

image

it is supposed to use the Arduino libraries instead.

It's not always true that using Arduino wiring library is the optimal choice; using the lower layer functions often gives performances improvements, and reduce the binary size.

PhilippMolitor commented 1 year ago

Thank you, that made it work. Do you think it makes sense to document this requirement? (at least I did not find it anywhere when looking through this repo).

Also, if you find it useful, feel free to link the URL to my boilerplate repo as an example if needed. It showcases the use of this library with a round 240x240 GC9A01 panel on a waveshare board. I will update it soon with the required changes.

tobozo commented 1 year ago

Well, the pico board was missing from the platformio CI build (only Arduino build tests were performed for this board), so thanks to you!

Here's the platformio config sample I've added based on our exchange (also test run):

https://github.com/lovyan03/LovyanGFX/blob/develop/examples/Test/build_test/platformio_rpipico.ini

Not really boilerplates, but some specific LGFX config samples are stored in the lgfx_user folder, so you're welcome to submit yours on the develop branch.