Skip to content

Commit

Permalink
lvgl 9 some detail added
Browse files Browse the repository at this point in the history
  • Loading branch information
ackPeng committed Jan 7, 2025
1 parent 7a0b052 commit 3590ed4
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 5 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/run-cl-arduino.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Run Ci Arduino

on:
push:
pull_request:
repository_dispatch:
types: [trigger-workflow]

jobs:
ci-arduino:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Checkout script repository
uses: actions/checkout@v4
with:
repository: Seeed-Studio/ci-arduino
path: ci


- name: Setup arduino cli
uses: arduino/[email protected]

- name: Create a depend.list file
run: |
# eg: echo "<repo>" >> depend.list
# echo "lvgl/lvgl" >> depend.list
# echo "lvgl/lv_demos" >> depend.list
echo "Bodmer/TFT_eSPI" >> depend.list
echo "moononournation/Arduino_GFX" >> depend.list
echo "tanakamasayuki/I2C_BM8563" >> depend.list
echo "arduino-libraries/SD" >> depend.list
echo "bitbank2/AnimatedGIF" >> depend.list
- name: Create a ignore.list file
run: |
# eg: echo "<path>,<fqbn>" >> ignore.list
# seeed_XIAO_m0 RAM and flash is too small
echo "HardwareTest,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
echo "LvglBenchmark,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
echo "TFT_Clock,Seeeduino:samd:seeed_XIAO_m0" >> ignore.list
# XIAO_RA4M1 RAM and flash is too small
echo "HardwareTest,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "LvglBenchmark,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
echo "TFT_eSPI_GifPlayer,Seeeduino:renesas_uno:XIAO_RA4M1" >> ignore.list
# TFT_eSPI not support XIAO_ESP32C6
echo "HardwareTest,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "LvglBenchmark,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "TFT_Clock,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "TFT_eSPI_Clock,esp32:esp32:XIAO_ESP32C6" >> ignore.list
echo "TFT_eSPI_GifPlayer,esp32:esp32:XIAO_ESP32C6" >> ignore.list
# AnimatedGIF not support XIAO_RP2040
echo "TFT_eSPI_GifPlayer,rp2040:rp2040:seeed_xiao_rp2350" >> ignore.list
- name: Install lvgl
run: |
mkdir -p /home/runner/Arduino/libraries
git clone --depth 1 https://github.com/lvgl/lvgl /home/runner/Arduino/libraries/lvgl
cp -r /home/runner/Arduino/libraries/lvgl/lv_conf_template.h /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#if 0/#if 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_USE_DEMO_WIDGETS 0/#define LV_USE_DEMO_WIDGETS 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_USE_DEMO_BENCHMARK 0/#define LV_USE_DEMO_BENCHMARK 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_FONT_MONTSERRAT_26 0/#define LV_FONT_MONTSERRAT_26 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_FONT_MONTSERRAT_14 0/#define LV_FONT_MONTSERRAT_14 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_FONT_MONTSERRAT_20 0/#define LV_FONT_MONTSERRAT_20 1/' /home/runner/Arduino/libraries/lv_conf.h
sed -i 's/#define LV_FONT_MONTSERRAT_24 0/#define LV_FONT_MONTSERRAT_24 1/' /home/runner/Arduino/libraries/lv_conf.h
ln -s /home/runner/Arduino/libraries/lvgl/demos /home/runner/Arduino/libraries/lvgl/src/demos
# git clone --depth 1 https://github.com/lvgl/lv_demos.git /home/runner/Arduino/libraries/lv_demos
# cp -r /home/runner/Arduino/libraries/lv_demos/lv_demo_conf_template.h /home/runner/Arduino/libraries/lv_demo_conf.h
# sed -i 's/#if 0/#if 1/' /home/runner/Arduino/libraries/lv_demo_conf.h
- name: Build sketch
run: |
./ci/tools/compile.sh
- name: Build result
run: |
cat build.log
if [ ${{ github.event_name }} == 'pull_request' ] && [ -f compile.failed ]; then
exit 1
fi
- name: Generate issue
if: ${{ github.event_name != 'pull_request' }}
run: ./ci/tools/issue.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion examples/HardwareTest/HardwareTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ void setup()
Serial.println( "XIAO round screen - LVGL_Arduino" );

lv_init();

#if LVGL_VERSION_MAJOR == 9
lv_tick_set_cb(millis);
#endif

lv_xiao_disp_init();
lv_xiao_touch_init();

Expand Down
2 changes: 2 additions & 0 deletions examples/HardwareTest/lv_hardware_test.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

#include <SD.h>
#include "I2C_BM8563.h"
#include <lvgl.h>

#include <lvgl_private.h>
#define NUM_ADC_SAMPLE 20
#define RP2040_VREF 3300 // The actual voltage on 3V3 pin. (unit: mV)
static lv_obj_t *slider_label;
Expand Down
7 changes: 5 additions & 2 deletions examples/LvglBenchmark/LvglBenchmark.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <lvgl.h>
#include <lv_demo.h>

#include <demos/lv_demos.h>
// uncomment a library for display driver
#define USE_TFT_ESPI_LIBRARY
// #define USE_ARDUINO_GFX_LIBRARY
Expand All @@ -14,6 +13,10 @@ void setup()

lv_init();

#if LVGL_VERSION_MAJOR == 9
lv_tick_set_cb(millis);
#endif

lv_xiao_disp_init();
lv_xiao_touch_init();

Expand Down
6 changes: 5 additions & 1 deletion examples/TFT_eSPI_GifPlayer/TFT_eSPI_GifPlayer.ino
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#include <vector>
#include <string>
#include <TFT_eSPI.h>
#include <SPI.h>
#include <SD.h>

#ifdef ARDUINO_ARCH_RP2350
#undef PICO_BUILD
#endif
#include "AnimatedGIF.h"

AnimatedGIF gif;
Expand Down Expand Up @@ -215,7 +219,7 @@ int getGifInventory( const char* basePath )

while( file ) {
if(!file.isDirectory()) {
GifFiles.push_back( file.name() );
GifFiles.push_back(std::string(file.name()));
amount++;
tft.drawString(String(amount), textPosX, textPosY );
file.close();
Expand Down
3 changes: 2 additions & 1 deletion src/lv_xiao_round_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void lv_xiao_disp_init(void)
xiao_disp_init();

#if LVGL_VERSION_MAJOR == 9
static uint8_t draw_buf[ SCREEN_WIDTH * LVGL_BUFF_SIZE * LV_COLOR_DEPTH / 8 ];
// static uint8_t draw_buf[ SCREEN_WIDTH * LVGL_BUFF_SIZE * LV_COLOR_DEPTH / 8 ];
static uint32_t draw_buf[ SCREEN_WIDTH * LVGL_BUFF_SIZE * LV_COLOR_DEPTH / 8 / 4 ];
lv_display_t * disp = lv_display_create(SCREEN_WIDTH, SCREEN_HEIGHT);
lv_display_set_flush_cb(disp, xiao_disp_flush);
lv_display_set_buffers(disp, (void*)draw_buf, NULL, sizeof(draw_buf), LV_DISPLAY_RENDER_MODE_PARTIAL);
Expand Down

0 comments on commit 3590ed4

Please sign in to comment.