-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from pimoroni/micropython-rebase
PicoSystem SDK port for MicroPython.
- Loading branch information
Showing
30 changed files
with
2,478 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: MicroPython | ||
|
||
on: | ||
push: | ||
pull_request: | ||
release: | ||
types: [created] | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
MICROPYTHON_VERSION: v1.17 | ||
BUILD_TYPE: Release | ||
BOARD_TYPE: PIMORONI_PICOSYSTEM | ||
|
||
jobs: | ||
build: | ||
name: ${{matrix.name}} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
name: Linux | ||
cache-key: linux | ||
apt-packages: clang-tidy gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib | ||
|
||
runs-on: ${{matrix.os}} | ||
|
||
steps: | ||
# Check out MicroPython | ||
- name: Checkout MicroPython | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: pimoroni/micropython | ||
ref: board/rp2/pimoroni_picosystem #${{env.MICROPYTHON_VERSION}} | ||
submodules: false # MicroPython submodules are hideously broken | ||
path: micropython | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
path: picosystem-${{ github.sha }} | ||
|
||
# HACK: Copy Python module files | ||
- name: Copy modules | ||
run: | | ||
cp -r picosystem-${GITHUB_SHA}/micropython/modules_py/* micropython/ports/rp2/modules/ | ||
cp -r picosystem-${GITHUB_SHA}/micropython/examples/picosystem/colour.py micropython/ports/rp2/modules/ | ||
cp -r picosystem-${GITHUB_SHA}/micropython/examples/picosystem/shapes.py micropython/ports/rp2/modules/ | ||
cp -r picosystem-${GITHUB_SHA}/micropython/examples/picosystem/launcher.py micropython/ports/rp2/modules/ | ||
# Linux deps | ||
- name: Install deps | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt update && sudo apt install ${{matrix.apt-packages}} | ||
- name: Fetch base MicroPython submodules | ||
shell: bash | ||
working-directory: micropython | ||
run: git submodule update --init | ||
|
||
- name: Fetch Pico SDK submodules | ||
shell: bash | ||
working-directory: micropython/lib/pico-sdk | ||
run: git submodule update --init | ||
|
||
- name: Build mpy-cross | ||
shell: bash | ||
working-directory: micropython/mpy-cross | ||
run: make | ||
|
||
- name: Build MicroPython | ||
shell: bash | ||
working-directory: micropython/ports/rp2 | ||
run: make USER_C_MODULES=../../../picosystem-${GITHUB_SHA}/micropython/modules/micropython.cmake BOARD=${BOARD_TYPE} -j2 | ||
|
||
- name: Rename .uf2 for artifact | ||
shell: bash | ||
working-directory: micropython/ports/rp2/build-${{env.BOARD_TYPE}} | ||
run: cp firmware.uf2 ${{github.event.repository.name}}-${{github.event.release.tag_name}}-micropython-${{env.MICROPYTHON_VERSION}}.uf2 | ||
|
||
- name: Store .uf2 as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{github.event.repository.name}}-${{ github.sha }}-micropython-${{env.MICROPYTHON_VERSION}}.uf2 | ||
path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/${{github.event.repository.name}}-${{github.event.release.tag_name}}-micropython-${{env.MICROPYTHON_VERSION}}.uf2 | ||
|
||
- name: Upload .uf2 | ||
if: github.event_name == 'release' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
asset_path: micropython/ports/rp2/build-${{env.BOARD_TYPE}}/firmware.uf2 | ||
upload_url: ${{github.event.release.upload_url}} | ||
asset_name: ${{github.event.repository.name}}-${{github.event.release.tag_name}}-micropython-${{env.MICROPYTHON_VERSION}}.uf2 | ||
asset_content_type: application/octet-stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Python | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: ${{matrix.name}} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-20.04 | ||
name: Linux | ||
cache-key: linux | ||
apt-packages: python3 python3-pip | ||
python-packages: flake8 | ||
|
||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Linux deps | ||
- name: Install deps | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt update && sudo apt install ${{matrix.apt-packages}} | ||
- name: Install Python Deps | ||
run: python3 -m pip install ${{matrix.python-packages}} | ||
|
||
- name: Lint | ||
shell: bash | ||
run: | | ||
python3 -m flake8 --ignore E501,F405,F821,F403 micropython/examples | ||
python3 -m flake8 --ignore E501,F405,F821,F403,F401 micropython/modules_py |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# PicoSystem MicroPython | ||
|
||
## Get the latest release | ||
|
||
## Build from source | ||
|
||
``` | ||
git clone https://github.com/pimoroni/micropython -b board/rp2/pimoroni_picosystem | ||
cd micropython | ||
git submodule update --init | ||
cd lib/pico-sdk | ||
git submodule update --init | ||
cd ../../micropython/mpy_cross | ||
make | ||
cd ../ports/rp2 | ||
cp ../../../picosystem/micropython/modules_py/boot.py modules/ | ||
make USER_C_MODULES=../../../picosystem/micropython/modules/micropython.cmake BOARD=PIMORONI_PICOSYSTEM | ||
cp build-PIMORONI_PICOSYSTEM/firmware.uf2 /path/to/RPI-RP2/ | ||
``` |
Oops, something went wrong.