Skip to content

Commit

Permalink
Merge pull request #639 from lovyan03/develop
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
lovyan03 authored Nov 22, 2024
2 parents 50a1800 + 4168ba6 commit 55a0f66
Show file tree
Hide file tree
Showing 51 changed files with 3,995 additions and 2,427 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/PicoSDKBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: PicoSDKBuild

env:
WORKSPACE_DIR: examples_for_picosdk
PROJECT_DIR: i2c

on:
push:
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**PicoSDKBuild.yml'
pull_request:
workflow_dispatch:

jobs:
build:
name: ${{ matrix.board }}@${{ matrix.sdk-version }}

runs-on: ubuntu-latest

strategy:
matrix:

include:
- { board: rp2350, sdk-version: 2.0.0, sdk-extras-version: sdk-2.0.0 }
- { board: rp2040, sdk-version: 2.0.0, sdk-extras-version: sdk-2.0.0 }
- { board: rp2040, sdk-version: 1.5.1, sdk-extras-version: sdk-1.5.1 }

fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: install deps
run: |
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
- name: compile
run: |
cd ${{env.WORKSPACE_DIR}}
git clone -b ${{ matrix.sdk-version }} --depth 1 https://github.com/raspberrypi/pico-sdk
git clone -b ${{ matrix.sdk-extras-version }} --depth 1 https://github.com/raspberrypi/pico-extras
cd pico-sdk
git submodule update --init
cd ..
export PICO_SDK_PATH="$(pwd)/pico-sdk"
export PICO_SDK_EXTRAS_PATH="$(pwd)/pico-extras"
export PICO_PLATFORM="${{ matrix.board }}"
cp pico-sdk/external/pico_sdk_import.cmake ./
cp pico-extras/external/pico_extras_import.cmake ./pico_extras_import_optional.cmake
cd ${{env.PROJECT_DIR}}
ln -sv ../../../LovyanGFX LovyanGFX
mkdir -p build
cd build
cmake ..
make -j $(nproc)
4 changes: 2 additions & 2 deletions .github/workflows/SDLBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
matrix:
include:
- { os: windows-latest }
- { os: macos-12 }
- { os: macos-latest }
- { os: ubuntu-latest }

steps:
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:


- name: Build LGFX_SDL2 for Mac
if: ${{ matrix.os == 'macos-12' }}
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install sdl2
cp .github/scripts/SDL.cmake ${{ env.PROJECT_DIR }}/CMakeLists.txt
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ sdkconfig*
build
.vs
.DS_Store
.directory
42 changes: 9 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
# CMakeLists for ESP-IDF
set (LGFX_ROOT ${CMAKE_CURRENT_LIST_DIR})

set(COMPONENT_ADD_INCLUDEDIRS
src
)
file(GLOB SRCS
src/lgfx/Fonts/efont/*.c
src/lgfx/Fonts/IPA/*.c
src/lgfx/utility/*.c
src/lgfx/v1/*.cpp
src/lgfx/v1/misc/*.cpp
src/lgfx/v1/panel/*.cpp
src/lgfx/v1/platforms/arduino_default/*.cpp
src/lgfx/v1/platforms/esp32/*.cpp
src/lgfx/v1/platforms/esp32c3/*.cpp
src/lgfx/v1/platforms/esp32s2/*.cpp
src/lgfx/v1/platforms/esp32s3/*.cpp
src/lgfx/v1/touch/*.cpp
)
# Espressif ESP* based boards
if (DEFINED ESP_PLATFORM)
include(${LGFX_ROOT}/boards.cmake/esp-idf.cmake)

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

if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
# Cannot determine boards type
else()
set(COMPONENT_REQUIRES nvs_flash efuse)
message("Error: No platform specified")
endif()


### If you use arduino-esp32 components, please activate next comment line.
# list(APPEND COMPONENT_REQUIRES arduino-esp32)


message(STATUS "LovyanGFX use components = ${COMPONENT_REQUIRES}")

register_component()
38 changes: 38 additions & 0 deletions boards.cmake/esp-idf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# CMakeLists for ESP-IDF

set(COMPONENT_ADD_INCLUDEDIRS
${LGFX_ROOT}/src
)
file(GLOB SRCS
${LGFX_ROOT}/src/lgfx/Fonts/efont/*.c
${LGFX_ROOT}/src/lgfx/Fonts/IPA/*.c
${LGFX_ROOT}/src/lgfx/utility/*.c
${LGFX_ROOT}/src/lgfx/v1/*.cpp
${LGFX_ROOT}/src/lgfx/v1/misc/*.cpp
${LGFX_ROOT}/src/lgfx/v1/panel/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/arduino_default/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32c3/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s2/*.cpp
${LGFX_ROOT}/src/lgfx/v1/platforms/esp32s3/*.cpp
${LGFX_ROOT}/src/lgfx/v1/touch/*.cpp
)

set(COMPONENT_SRCS ${SRCS})

if (IDF_VERSION_MAJOR GREATER_EQUAL 5)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd driver esp_timer)
elseif ((IDF_VERSION_MAJOR EQUAL 4) AND (IDF_VERSION_MINOR GREATER 3) OR IDF_VERSION_MAJOR GREATER 4)
set(COMPONENT_REQUIRES nvs_flash efuse esp_lcd)
else()
set(COMPONENT_REQUIRES nvs_flash efuse)
endif()


### If you use arduino-esp32 components, please activate next comment line.
# list(APPEND COMPONENT_REQUIRES arduino-esp32)


message(STATUS "LovyanGFX use components = ${COMPONENT_REQUIRES}")

register_component()
50 changes: 50 additions & 0 deletions boards.cmake/pico-sdk.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CMakeLists for PICO SDK

include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)

pico_sdk_init()

add_compile_definitions(
USE_PICO_SDK=1
)

# pico_add_library()
add_library(LovyanGFX_headers INTERFACE)
add_library(LovyanGFX INTERFACE)

target_include_directories(
LovyanGFX_headers INTERFACE
src
)

#add_compile_definitions
target_compile_definitions(LovyanGFX INTERFACE
USE_PICO_SDK
)

file(GLOB SRCS
src/lgfx/Fonts/efont/*.c
src/lgfx/Fonts/IPA/*.c
src/lgfx/utility/*.c
src/lgfx/v1/*.cpp
src/lgfx/v1/misc/*.cpp
src/lgfx/v1/panel/*.cpp
src/lgfx/v1/platforms/arduino_default/*.cpp
src/lgfx/v1/platforms/rp2040/*.cpp
src/lgfx/v1/touch/*.cpp
)
target_sources(LovyanGFX INTERFACE ${SRCS})
target_link_libraries(LovyanGFX INTERFACE
LovyanGFX_headers
pico_stdlib
pico_float
pico_double
hardware_dma
hardware_gpio
hardware_spi
hardware_i2c
hardware_pwm
)

pico_enable_stdio_usb(LovyanGFX 0)
pico_enable_stdio_uart(LovyanGFX 1)
Loading

0 comments on commit 55a0f66

Please sign in to comment.