Skip to content

Commit

Permalink
Switch to PlatformIO
Browse files Browse the repository at this point in the history
  • Loading branch information
DoomHammer committed Oct 9, 2023
1 parent 509c3dc commit 0a9bfdf
Show file tree
Hide file tree
Showing 24 changed files with 3,456 additions and 344 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_nix
46 changes: 46 additions & 0 deletions .github/workflows/pio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: PlatformIO Build

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

outputs:
pkgfile: ${{ steps.pkgname.outputs.pkgfile }}

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt update -qq
sudo apt install -yqq python3
pip install -U platformio
- name: Update PlatformIO
run: |
cd "$(realpath "$GITHUB_WORKSPACE")"
pio pkg update
- name: Build firmware
run: |
platformio run
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: bin
path: ".pio/build/firmware.bin"

- name: Release build artifacts
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./.pio/build/firmware.bin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Check PR
on:
workflow_dispatch:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- uses: cloudposse/[email protected]
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-toml
- id: check-json
exclude: ^.vscode/
- id: check-xml
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
hooks:
- id: clang-format
exclude: ^.vscode/
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# ninja-stopwatch
# Ninja Stopwatch

Please use those libraries for ESP8266WIFI:
https://github.com/esp8266/Arduino
A big display for ninja competitions (think Ninja Warrior or Sasuke).

For ESP8266 on Windows 10 following driver is required:
https://www.arduined.eu/ch340-windows-10-driver-download/
It uses 8 P10 HUB12 LED panels in a 4x2 grid to get a display of 128x32px
(correspondingly 128x32cm in size).
26 changes: 26 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ pkgs ? import (
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/22.11.tar.gz";
sha256 = "11w3wn2yjhaa5pv20gbfbirvjq6i3m7pqrq2msf0g7cv44vijwgw";
}
) {} }:

with pkgs;

mkShell {
buildInputs = [
clang-tools
pre-commit
(python310.withPackages (ps: with ps; [
pip
virtualenv
]))
];
shellHook = ''
virtualenv venv
source venv/bin/activate
pip install platformio
pio pkg update
pre-commit install
'';
}
123 changes: 0 additions & 123 deletions ninja_stopwatch_start.ino

This file was deleted.

92 changes: 0 additions & 92 deletions ninja_stopwatch_stop.ino

This file was deleted.

9 changes: 9 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[env]
framework = arduino
lib_deps =
DMD2 @ ^0.0.4
ezButton @ ^1.0.4

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
Loading

0 comments on commit 0a9bfdf

Please sign in to comment.