From 649b30cef24267196c80dfd7c04b5a7560fd2a63 Mon Sep 17 00:00:00 2001 From: Gabor Peresztegi Date: Tue, 4 Mar 2025 20:24:35 +0100 Subject: [PATCH] Fix github workflows and build issues --- .github/workflows/js-port-v9.yml | 2 +- .github/workflows/rp2_port.yml | 6 +++--- .github/workflows/ruff.yml | 2 ++ .github/workflows/unix_port.yml | 4 ++-- README-LVGL.md | 6 +++--- ports/esp32/boards/M5STACK_CORE2/board.json | 18 +++++++----------- .../boards/M5STACK_CORE2/modules/power.py | 2 +- user_modules/lv_binding_micropython | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/js-port-v9.yml b/.github/workflows/js-port-v9.yml index 92e0cb6ea..38543d52d 100644 --- a/.github/workflows/js-port-v9.yml +++ b/.github/workflows/js-port-v9.yml @@ -55,7 +55,7 @@ jobs: working-directory: ports/javascript - name: Retrieve version run: | - echo "::set-output name=VERSION_NAME::$(lib/lv_bindings/lvgl/scripts/find_version.sh)" + echo "::set-output name=VERSION_NAME::$(user_modules/lv_binding_micropython/lvgl/scripts/find_version.sh)" id: version - name: Deploy uses: JamesIves/github-pages-deploy-action@4.1.3 diff --git a/.github/workflows/rp2_port.yml b/.github/workflows/rp2_port.yml index d5799f1d5..8630ed4b3 100644 --- a/.github/workflows/rp2_port.yml +++ b/.github/workflows/rp2_port.yml @@ -17,13 +17,13 @@ jobs: with: release: '9-2019-q4' # The arm-none-eabi-gcc release to use. - name: Initialize lv_bindings submodule - run: git submodule update --init --recursive lib/lv_bindings + run: git submodule update --init --recursive user_modules/lv_binding_micropython - name: Initialize Micropython submodules - run: make -C ports/rp2 BOARD=${{ matrix.board }} USER_C_MODULES=../../lib/lv_bindings/bindings.cmake submodules + run: make -C ports/rp2 BOARD=${{ matrix.board }} USER_C_MODULES=../../user_modules/lv_binding_micropython/bindings.cmake submodules - name: Build mpy-cross run: make -j $(nproc) -C mpy-cross - name: Build ${{ matrix.board }} - run: make -j $(nproc) -C ports/rp2 BOARD=${{ matrix.board }} USER_C_MODULES=../../lib/lv_bindings/bindings.cmake + run: make -j $(nproc) -C ports/rp2 BOARD=${{ matrix.board }} USER_C_MODULES=../../user_modules/lv_binding_micropython/bindings.cmake - uses: actions/upload-artifact@v2 if: ${{ env.GITHUB_EVENT_NAME }} == 'push' with: diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index 29e9ddbf8..30ae27c01 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -7,6 +7,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Initialize lv_bindings submodule + run: git submodule update --init --recursive user_modules/lv_binding_micropython # ruff version should be kept in sync with .pre-commit-config.yaml - run: pip install --user ruff==0.1.3 - run: ruff check --output-format=github . diff --git a/.github/workflows/unix_port.yml b/.github/workflows/unix_port.yml index 515a7e731..5b8c032a7 100644 --- a/.github/workflows/unix_port.yml +++ b/.github/workflows/unix_port.yml @@ -17,7 +17,7 @@ jobs: sudo apt-get update -y -qq sudo apt-get install libsdl2-dev parallel libfreetype-dev librlottie-dev libavformat-dev libavcodec-dev libswscale-dev libavutil-dev - name: Initialize lv_bindings submodule - run: git submodule update --init --recursive lib/lv_bindings + run: git submodule update --init --recursive user_modules/lv_binding_micropython - name: Update submodules run: make -C ports/unix DEBUG=1 submodules - name: Build mpy-cross @@ -27,5 +27,5 @@ jobs: - name: Run tests run: | export XDG_RUNTIME_DIR=/tmp - lib/lv_bindings/tests/run.sh + user_modules/lv_binding_micropython/tests/run.sh diff --git a/README-LVGL.md b/README-LVGL.md index e35dbb62f..f332139b4 100644 --- a/README-LVGL.md +++ b/README-LVGL.md @@ -83,7 +83,7 @@ make -C mpy-cross make -C ports/esp32 LV_CFLAGS="-DLV_COLOR_DEPTH=16" BOARD=GENERIC_SPIRAM deploy ``` -Explanation about the paramters: +Explanation about the parameters: - `LV_CFLAGS` are used to override color depth, for ILI9341 compatibility. - `LV_COLOR_DEPTH=16` is needed if you plan to use the ILI9341 driver. - `BOARD` - I use WROVER board with SPIRAM. You can choose other boards from `ports/esp32/boards/` directory. @@ -148,7 +148,7 @@ import lvgl as lv from ili9341 import ili9341 disp = ili9341() -# Import XPT2046 driver and initalize it +# Import XPT2046 driver and initialize it from xpt2046 import xpt2046 touch = xpt2046() @@ -160,7 +160,7 @@ By default, both ILI9341 and XPT2046 are initialized on the same SPI bus with th - XPT2046: `cs=25, spihost=esp.HSPI_HOST, mhz=5, max_cmds=16, cal_x0 = 3783, cal_y0 = 3948, cal_x1 = 242, cal_y1 = 423, transpose = True, samples = 3` You can change any of these parameters on ili9341/xpt2046 constructor. -You can also initalize them on different SPI buses if you want, by providing miso/mosi/clk parameters. Set them to -1 to use existing (initialized) spihost bus. +You can also initialize them on different SPI buses if you want, by providing miso/mosi/clk parameters. Set them to -1 to use existing (initialized) spihost bus. Now you can create the GUI itself: diff --git a/ports/esp32/boards/M5STACK_CORE2/board.json b/ports/esp32/boards/M5STACK_CORE2/board.json index f0762ee61..5f4de6712 100644 --- a/ports/esp32/boards/M5STACK_CORE2/board.json +++ b/ports/esp32/boards/M5STACK_CORE2/board.json @@ -6,18 +6,14 @@ "features": [ "BLE", "WiFi", - "SPIRAM", - "LCD", - "LED", - "IMU", - "RTC", - "PMU", + "External Flash", + "External RAM", "SDCard", - "Button", - "Speaker", - "Microphone", - "Vibration Motor", - "USB-C" + "IMU", + "USB-C", + "Battery Charging", + "Display", + "Microphone" ], "images": [ "m5core2.jpg" diff --git a/ports/esp32/boards/M5STACK_CORE2/modules/power.py b/ports/esp32/boards/M5STACK_CORE2/modules/power.py index d14f92106..abd3ed836 100644 --- a/ports/esp32/boards/M5STACK_CORE2/modules/power.py +++ b/ports/esp32/boards/M5STACK_CORE2/modules/power.py @@ -74,7 +74,7 @@ class Power(): # True turns on at 2V, False or 0 turns off. Alternatively, specify a voltage in range 1.8 - 3.3 volts. def vibrator(self, state): - if type(state) == bool and state: + if isinstance(state, bool) and state: self.axp.write(VIBRATOR, 2.0) else: self.axp.write(VIBRATOR, state) diff --git a/user_modules/lv_binding_micropython b/user_modules/lv_binding_micropython index b9c5cb842..1c7258270 160000 --- a/user_modules/lv_binding_micropython +++ b/user_modules/lv_binding_micropython @@ -1 +1 @@ -Subproject commit b9c5cb84221d52e07a51100987d68f47c34acd0b +Subproject commit 1c7258270d9b2fef5839c1327d762ec71c212b98