-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build firmware with PlatformIO, enable CI (#1)
* 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
1 parent
3b98c69
commit a4d2c75
Showing
3 changed files
with
93 additions
and
0 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,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.* |
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,2 @@ | ||
.pio | ||
.vscode |
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,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 |