Skip to content

Commit 55a0f66

Browse files
authored
Merge pull request #639 from lovyan03/develop
1.2.0
2 parents 50a1800 + 4168ba6 commit 55a0f66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3995
-2427
lines changed

.github/workflows/PicoSDKBuild.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: PicoSDKBuild
2+
3+
env:
4+
WORKSPACE_DIR: examples_for_picosdk
5+
PROJECT_DIR: i2c
6+
7+
on:
8+
push:
9+
paths:
10+
- '**.ino'
11+
- '**.cpp'
12+
- '**.hpp'
13+
- '**.h'
14+
- '**.c'
15+
- '**PicoSDKBuild.yml'
16+
pull_request:
17+
workflow_dispatch:
18+
19+
jobs:
20+
build:
21+
name: ${{ matrix.board }}@${{ matrix.sdk-version }}
22+
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
matrix:
27+
28+
include:
29+
- { board: rp2350, sdk-version: 2.0.0, sdk-extras-version: sdk-2.0.0 }
30+
- { board: rp2040, sdk-version: 2.0.0, sdk-extras-version: sdk-2.0.0 }
31+
- { board: rp2040, sdk-version: 1.5.1, sdk-extras-version: sdk-1.5.1 }
32+
33+
fail-fast: false
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
ref: ${{ github.event.pull_request.head.sha }}
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: '3.9'
45+
46+
- name: install deps
47+
run: |
48+
sudo apt install ca-certificates build-essential avr-libc gcc-avr gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib libusb-1.0-0-dev cmake
49+
50+
- name: compile
51+
run: |
52+
cd ${{env.WORKSPACE_DIR}}
53+
54+
git clone -b ${{ matrix.sdk-version }} --depth 1 https://github.com/raspberrypi/pico-sdk
55+
git clone -b ${{ matrix.sdk-extras-version }} --depth 1 https://github.com/raspberrypi/pico-extras
56+
57+
cd pico-sdk
58+
git submodule update --init
59+
cd ..
60+
61+
export PICO_SDK_PATH="$(pwd)/pico-sdk"
62+
export PICO_SDK_EXTRAS_PATH="$(pwd)/pico-extras"
63+
export PICO_PLATFORM="${{ matrix.board }}"
64+
65+
cp pico-sdk/external/pico_sdk_import.cmake ./
66+
cp pico-extras/external/pico_extras_import.cmake ./pico_extras_import_optional.cmake
67+
68+
cd ${{env.PROJECT_DIR}}
69+
ln -sv ../../../LovyanGFX LovyanGFX
70+
71+
mkdir -p build
72+
cd build
73+
cmake ..
74+
make -j $(nproc)
75+

.github/workflows/SDLBuild.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
include:
4646
- { os: windows-latest }
47-
- { os: macos-12 }
47+
- { os: macos-latest }
4848
- { os: ubuntu-latest }
4949

5050
steps:
@@ -117,7 +117,7 @@ jobs:
117117

118118

119119
- name: Build LGFX_SDL2 for Mac
120-
if: ${{ matrix.os == 'macos-12' }}
120+
if: ${{ matrix.os == 'macos-latest' }}
121121
run: |
122122
brew install sdl2
123123
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sdkconfig*
44
build
55
.vs
66
.DS_Store
7+
.directory

CMakeLists.txt

+9-33
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,14 @@
1-
# CMakeLists for ESP-IDF
1+
set (LGFX_ROOT ${CMAKE_CURRENT_LIST_DIR})
22

3-
set(COMPONENT_ADD_INCLUDEDIRS
4-
src
5-
)
6-
file(GLOB SRCS
7-
src/lgfx/Fonts/efont/*.c
8-
src/lgfx/Fonts/IPA/*.c
9-
src/lgfx/utility/*.c
10-
src/lgfx/v1/*.cpp
11-
src/lgfx/v1/misc/*.cpp
12-
src/lgfx/v1/panel/*.cpp
13-
src/lgfx/v1/platforms/arduino_default/*.cpp
14-
src/lgfx/v1/platforms/esp32/*.cpp
15-
src/lgfx/v1/platforms/esp32c3/*.cpp
16-
src/lgfx/v1/platforms/esp32s2/*.cpp
17-
src/lgfx/v1/platforms/esp32s3/*.cpp
18-
src/lgfx/v1/touch/*.cpp
19-
)
3+
# Espressif ESP* based boards
4+
if (DEFINED ESP_PLATFORM)
5+
include(${LGFX_ROOT}/boards.cmake/esp-idf.cmake)
206

21-
set(COMPONENT_SRCS ${SRCS})
7+
# Raspberry Pi RP* based boards
8+
elseif ((DEFINED PICO_PLATFORM) OR (DEFINED PICO_BOARD))
9+
include(${LGFX_ROOT}/boards.cmake/pico-sdk.cmake)
2210

23-
if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
24-
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
25-
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
26-
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
11+
# Cannot determine boards type
2712
else()
28-
set(COMPONENT_REQUIRES nvs_flash efuse)
13+
message("Error: No platform specified")
2914
endif()
30-
31-
32-
### If you use arduino-esp32 components, please activate next comment line.
33-
# list(APPEND COMPONENT_REQUIRES arduino-esp32)
34-
35-
36-
message(STATUS "LovyanGFX use components = ${COMPONENT_REQUIRES}")
37-
38-
register_component()

boards.cmake/esp-idf.cmake

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# CMakeLists for ESP-IDF
2+
3+
set(COMPONENT_ADD_INCLUDEDIRS
4+
${LGFX_ROOT}/src
5+
)
6+
file(GLOB SRCS
7+
${LGFX_ROOT}/src/lgfx/Fonts/efont/*.c
8+
${LGFX_ROOT}/src/lgfx/Fonts/IPA/*.c
9+
${LGFX_ROOT}/src/lgfx/utility/*.c
10+
${LGFX_ROOT}/src/lgfx/v1/*.cpp
11+
${LGFX_ROOT}/src/lgfx/v1/misc/*.cpp
12+
${LGFX_ROOT}/src/lgfx/v1/panel/*.cpp
13+
${LGFX_ROOT}/src/lgfx/v1/platforms/arduino_default/*.cpp
14+
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32/*.cpp
15+
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32c3/*.cpp
16+
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s2/*.cpp
17+
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s3/*.cpp
18+
${LGFX_ROOT}/src/lgfx/v1/touch/*.cpp
19+
)
20+
21+
set(COMPONENT_SRCS ${SRCS})
22+
23+
if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
24+
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
25+
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
26+
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
27+
else()
28+
set(COMPONENT_REQUIRES nvs_flash efuse)
29+
endif()
30+
31+
32+
### If you use arduino-esp32 components, please activate next comment line.
33+
# list(APPEND COMPONENT_REQUIRES arduino-esp32)
34+
35+
36+
message(STATUS "LovyanGFX use components = ${COMPONENT_REQUIRES}")
37+
38+
register_component()

boards.cmake/pico-sdk.cmake

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# CMakeLists for PICO SDK
2+
3+
include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)
4+
5+
pico_sdk_init()
6+
7+
add_compile_definitions(
8+
USE_PICO_SDK=1
9+
)
10+
11+
# pico_add_library()
12+
add_library(LovyanGFX_headers INTERFACE)
13+
add_library(LovyanGFX INTERFACE)
14+
15+
target_include_directories(
16+
LovyanGFX_headers INTERFACE
17+
src
18+
)
19+
20+
#add_compile_definitions
21+
target_compile_definitions(LovyanGFX INTERFACE
22+
USE_PICO_SDK
23+
)
24+
25+
file(GLOB SRCS
26+
src/lgfx/Fonts/efont/*.c
27+
src/lgfx/Fonts/IPA/*.c
28+
src/lgfx/utility/*.c
29+
src/lgfx/v1/*.cpp
30+
src/lgfx/v1/misc/*.cpp
31+
src/lgfx/v1/panel/*.cpp
32+
src/lgfx/v1/platforms/arduino_default/*.cpp
33+
src/lgfx/v1/platforms/rp2040/*.cpp
34+
src/lgfx/v1/touch/*.cpp
35+
)
36+
target_sources(LovyanGFX INTERFACE ${SRCS})
37+
target_link_libraries(LovyanGFX INTERFACE
38+
LovyanGFX_headers
39+
pico_stdlib
40+
pico_float
41+
pico_double
42+
hardware_dma
43+
hardware_gpio
44+
hardware_spi
45+
hardware_i2c
46+
hardware_pwm
47+
)
48+
49+
pico_enable_stdio_usb(LovyanGFX 0)
50+
pico_enable_stdio_uart(LovyanGFX 1)

0 commit comments

Comments
 (0)