Skip to content

Commit

Permalink
Hey, Presto!
Browse files Browse the repository at this point in the history
Co-authored-by: Mike Bell <[email protected]>
  • Loading branch information
Gadgetoid and MichaelBell committed Aug 13, 2024
1 parent 3ecdbf4 commit 8467b6c
Show file tree
Hide file tree
Showing 35 changed files with 978 additions and 329 deletions.
57 changes: 42 additions & 15 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,23 @@ jobs:
strategy:
matrix:
include:
- name: pga2040
board: pga2040
- name: presto
board: presto
variant:
modules: default
- name: pga2350
board: pga2350
modules: default
- name: pga2350-psram # Friendly-name for output files
board: pga2350 # /<board>
variant: PSRAM # /<board>/mpconfigvariant_<variant>.cmake
modules: default # /modules/<modules>.cmake

env:
# MicroPython version will be contained in github.event.release.tag_name for releases
RELEASE_FILE: ${{ matrix.name }}-${{ github.event.release.tag_name || github.sha }}-micropython
PIMORONI_PICO_DIR: "${{ github.workspace }}/pimoroni-pico"
MICROPY_BOARD_DIR: "${{ github.workspace }}/src-${{ github.sha }}/${{ matrix.BOARD }}"
USER_C_MODULES: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.cmake"
USER_FS_MANIFEST: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.txt"
USER_FS_SOURCE: "${{ github.workspace }}/src-${{ github.sha }}/modules/littlefs"
TAG_OR_SHA: ${{ github.event.release.tag_name || github.sha }}
MICROPY_BOARD: ${{ matrix.board }}
MICROPY_BOARD_VARIANT: ${{ matrix.variant }}
MICROPY_BOARD_DIR: "${{ github.workspace }}/src-${{ github.sha }}/${{ matrix.BOARD }}"
MICROPY_FROZEN_MANIFEST: "${{ github.workspace }}/src-${{ github.sha }}/modules/${{ matrix.modules }}.py"
BOARD_NAME: ${{ matrix.name }}
BUILD_TOOLS: src-${{ github.sha }}/ci/micropython.sh

Expand Down Expand Up @@ -81,12 +78,19 @@ jobs:
source $BUILD_TOOLS
micropython_clone
- name: "Py_Decl: Checkout py_decl"
- name: "Py_Decl: Checkout"
uses: actions/checkout@v4
with:
repository: gadgetoid/py_decl
ref: v0.0.2
path: py_decl

- name: "dir2uf2: Checkout"
uses: actions/checkout@v4
with:
repository: gadgetoid/dir2uf2
ref: v0.0.7
path: dir2uf2

- name: "MicroPython: Build MPY Cross"
run: |
Expand All @@ -106,24 +110,47 @@ jobs:
source $BUILD_TOOLS
cmake_build
- name: "Py_Decl: Verify UF2"
- name: "Py_Decl: Verify .uf2"
shell: bash
run: |
python3 py_decl/py_decl.py --to-json --verify build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
- name: Store .uf2 as artifact
- name: "dir2uf2: Append filesystem to .uf2"
shell: bash
run: |
python3 -m pip install littlefs-python==0.12.0
./dir2uf2/dir2uf2 --fs-compact --append-to build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2 --manifest ${{env.USER_FS_MANIFEST}} --filename with-filesystem.uf2 ${{env.USER_FS_SOURCE}}/
- name: "Artifacts: Upload .uf2"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}.uf2
path: build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2

- name: Upload .uf2
- name: "Artifacts: Upload .uf2 with filesystem"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
path: ${{ env.RELEASE_FILE }}-with-filesystem.uf2

- name: "Release: Upload .uf2"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: build-${{ matrix.name }}/firmware.uf2
asset_path: build-${{ matrix.name }}/${{ env.RELEASE_FILE }}.uf2
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.RELEASE_FILE }}.uf2
asset_content_type: application/octet-stream

- name: "Release: Upload .uf2 with filesystem"
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_path: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ env.RELEASE_FILE }}-with-filesystem.uf2
asset_content_type: application/octet-stream
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
# Pimoroni PGA Boilerplate

This repository is intended to provide a baseline MicroPython build for PGA2040
and PGA2350, in addition to being a minimal example of how you might set up your
own custom MicroPython flavour to support your PGA-based project.

Use this repository as a boilerplate to set up your own project, and GitHub actions
should automatically handle building MicroPython for you.

## Contents

* pga2040 - MicroPython and Pico SDK board definitions for PGA2040
* pga2350 - MicroPython and Pico SDK board definitions for PGA2350, with PSRAM variant
* modules/c/example - An example MicroPython C++ module, demonstrating C class bindings
* modules/py_frozen - Python files intended to be frozen into the firmware
* modules/py_littlefs - Python files intended to be visible/editable in the LittleFS user filesystem
# Pimoroni Presto
1 change: 1 addition & 0 deletions ci/micropython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function cmake_configure {
-DMICROPY_BOARD_DIR=$MICROPY_BOARD_DIR \
-DMICROPY_BOARD=$MICROPY_BOARD \
-DMICROPY_BOARD_VARIANT=$MICROPY_BOARD_VARIANT \
-DMICROPY_FROZEN_MANIFEST=$MICROPY_FROZEN_MANIFEST \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
}
Expand Down
1 change: 1 addition & 0 deletions drivers/st7701/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/st7701_presto.cmake)
Loading

0 comments on commit 8467b6c

Please sign in to comment.