Skip to content

Commit

Permalink
Build firmware with PlatformIO, enable CI (#1)
Browse files Browse the repository at this point in the history
* Build firmware with PlatformIO, enable CI

* Fix paths for archive

* Use ATTIny 2.0.0-dev core from registry, add upload command reference

---------

Co-authored-by: unknown <maximilian.gerhardt@rub.de>
  • Loading branch information
mooinglemur and maxgerhardt authored Feb 12, 2023
1 parent 3b98c69 commit a4d2c75
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PlatformIO CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project
run: pio run
- name: Archive firmwares results
uses: actions/upload-artifact@v3
with:
name: SMC Firmwares
path: .pio/build/**/firmware.*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.pio
.vscode
62 changes: 62 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = .
include_dir = .

[env]
; common settings
platform = atmelavr@4.0.0
framework = arduino
; libraries common to all
lib_deps =
mathertel/OneButton@2.0.3
; exclude source files in the tests folder meant for cx16
build_src_filter = +<*> -<tests/*>

[env:uno]
board = uno

[env:uno_debug]
extends = env:uno
build_flags = -DUSE_SERIAL_DEBUG

[env:uno_nmi_button]
extends = env:uno
build_flags = -DENABLE_NMI_BUT

[env:attiny861]
board = attiny861
; as visible in the pinout code (D2 and D14 being used for interrupts), this uses the 2.0.0 preview
; not the stable 1.5.2 core.
; feed in the appropriate package from the trusted registry.
platform_packages =
maxgerhardt/framework-arduino-avr-attiny@2.0.0-dev
; if you want to upload the firmware to the ATTiny via PlatformIO, select programmer here
; in accordance to https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer
; example is for USBtinyISP.
upload_protocol = custom
upload_flags =
-C
${platformio.packages_dir}/tool-avrdude/avrdude.conf
-p
$BOARD_MCU
-c
usbtiny
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

[env:attiny861_debug]
extends = env:attiny861
build_flags = -DUSE_SERIAL_DEBUG

[env:attiny861_nmi_button]
extends = env:attiny861
build_flags = -DENABLE_NMI_BUT

0 comments on commit a4d2c75

Please sign in to comment.