lvgl-micropython / lvgl_micropython

LVGL module for MicroPython
MIT License
62 stars 19 forks source link

There is an oversight in the mpthreadport.c file, which will cause errors in compiling the esp32s3 firmware #108

Closed Phil-LJZ closed 2 weeks ago

Phil-LJZ commented 2 weeks ago

I get an error when compiling the esp32s3 firmware. Here is my compilation process

$ git clone https://github.com/lvgl-micropython/lvgl_micropython.git
$ cd lvgl_micropython
$ python3 make.py esp32 submodules clean mpy_cross BOARD=ESP32_GENERIC_S3 BOARD_VARIANT=SPIRAM_OCT DISPLAY=ili9341 INDEV=ft6x36 --flash-size=16

The following are some of the error tips during the compilation process.

[1121/1966] Building C object esp-idf/espressif__mdns/CMakeFiles/
[1122/1966] Linking C static library esp-idf/espressif__mdns/libe
[1123/1966] Linking C static library esp-idf/esp_local_ctrl/libes
[1124/1966] Generating ../../genhdr/qstr.i.last                                
FAILED: genhdr/qstr.i.last /home/phil/lvgl_micropython/lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/genhdr/qstr.i.last
/bin/sh esp-idf/main_esp32s3/CMakeFiles/qstr.i.last-93c470f.sh 1191b78f066e9993
/home/phil/lvgl_micropython/lib/micropython/ports/esp32/mpthreadport.c:38:22: error: missing binary operator before token "#"
38 | #if MICROPY_PY_THREAD#if (MP_USE_DUAL_CORE && !CONFIG_FREERTOS_UNICORE)
|                      ^
/home/phil/lvgl_micropython/lib/micropython/ports/esp32/mpthreadport.c:255:2: error: #else without #if
255 | #else
|  ^~~~
/home/phil/lvgl_micropython/lib/micropython/ports/esp32/mpthreadport.c:260:2: error: #endif without #if
260 | #endif // MICROPY_PY_THREAD
|  ^~~~~

According to the prompt, the file /lvgl_micropython/lib/micropython/ports/esp32/mpthreadport.c has a syntax error. This seems to be no line change.

So I found this file in that folder and corrected it. I tried to recompile it, and it succeeded as expected.

The following is the code I changed

38 #if MICROPY_PY_THREAD
39 #if (MP_USE_DUAL_CORE && !CONFIG_FREERTOS_UNICORE)
40     #define _CORE_ID    tskNO_AFFINITY
41 #else
42     #define _CORE_ID    MP_TASK_COREID
43 #endif
kdschlosser commented 2 weeks ago

Thanks for reporting this. I had to add a couple of commas to the build script.