From ebfa563d314599afbb488b8d779c597279fe3621 Mon Sep 17 00:00:00 2001 From: Tom Hensel Date: Sun, 5 Nov 2023 03:47:30 +0100 Subject: basic compile workflow publishing artifacts to test --- .github/workflows/compile.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/compile.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..9b06253 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,33 @@ +name: anduril + +on: + push: + branches: [ "main", "actions" ] + pull_request: + branches: [ "main" ] + +jobs: + compile: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@master + - name: Requirements + run: | + sudo apt-get -qqy update + sudo apt-get -qqy install avr-libc binutils-avr wget gcc-avr unzip + - name: Install Device Family Pack + run: | + ./make dfp + - name: Compile All + run: | + ./bin/build-all.sh + echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" + - name: Store Artifacts + uses: actions/upload-artifact@master + with: + name: ${{ env.ARTIFACT_NAME }} + if-no-files-found: error + path: | + hex/*.hex -- cgit v1.2.3 From c809a04bf378124cedfb5606ede2fa29862c8d5c Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 11:51:17 -0700 Subject: docs: added info on contributing, fixed minor formatting issues --- README.md | 23 +++++++++++++++++++++++ docs/anduril-manual.md | 39 +++++++++++++++++++++++++-------------- 2 files changed, 48 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4bad7ad..ba0786e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ you like, such as "Flashlight" or whatever suits your mood. FSM also means "Finite State Machine", which is the type of abstraction used for defining user interfaces. It is like a flowchart turned into executable code. + ## Using Anduril Anduril has many features, but the only things a person *really* needs to know @@ -25,6 +26,7 @@ For info about hardware-specific features, like what the channel modes are on multi-channel lights, browse into the [hw/](hw/) directories to find the hardware model and any hardware-specific documentation. + ## Flashing Firmware Get the latest updates by flashing new firmware! @@ -57,6 +59,7 @@ One particularly useful guide is at https://anduril.click/ . More info about installing flashing programs is below, in [Flashing Programs](#flashing-programs). + ## Compiling The firmware can be deeply customized by modifying it and compiling your own @@ -91,6 +94,7 @@ firmwares for Hanklights with optional boost drivers. The compiled firmware goes into the `hex/` directory, ready to be used by any firmware flashing program. + ## Customizing Settings Per User The build can be [customized per user](docs/per-user-config.md) by placing @@ -98,6 +102,7 @@ overrides into the `users/myname/` directory and letting the build script know your username. That way, your favorite settings can be applied automatically without having to modify the original source files. + ## Flashing Programs ### AVRdude @@ -121,3 +126,21 @@ You'll need to `source env/bin/activate` every time you start a fresh shell, if you want to use pymcuprog. The activation lasts until the shell is closed or until you run `deactivate`. + +## Contributing + +If you'd like to help, there are several ways... + + - ToyKeeper has a [Patreon site](https://patreon.com/ToyKeeper) for + donations, to help figuratively and literally keep the lights on. + + - Send pull requests or patches, to improve things directly. These can be + code, documentation, tools, or anything you think is useful. + + - File bug reports for any problems you find. + + - Answer people's questions on public forums. If the same questions come up + a lot, consider adding it to the documentation here. + + - Ask manufacturers to use this firmware, and to support its development. + diff --git a/docs/anduril-manual.md b/docs/anduril-manual.md index 79b39c0..830ecde 100644 --- a/docs/anduril-manual.md +++ b/docs/anduril-manual.md @@ -225,8 +225,9 @@ While the light is on, a few actions are available: - `2C`: Go to or from the turbo level. (or if it has regulated down, "bump" back up to turbo) (turbo level / behavior is configurable) - - `1H`: Change brightness (up). If the button was released less than a - second ago, or if it's already at the ceiling, it goes down instead. + - `1H`: Change brightness (up). + If the button was released less than a second ago, or if it's already + at the ceiling, it goes down instead. - `2H`: Change brightness (down). - `3C`: Switch to the other ramp style. (smooth / stepped) @@ -595,8 +596,8 @@ in Ramp Mode before entering momentary mode. In momentary strobe mode, the settings are copied from the last-used strobe mode, such as party strobe, tactical strobe, or lightning. -To exit this mode, physically disconnect power by unscrewing the tailcap -or battery tube. +**To exit Momentary Mode, physically disconnect power** by unscrewing the +tailcap or battery tube. Tactical Mode @@ -678,23 +679,33 @@ not active, then do a `10H` action from Off. For smooth ramping mode, there are three menu options: - 1. Floor. (default = 1/150) - 2. Ceiling. (default = 120/150) - 3. Ramp speed. (default = 1, fastest speed) + 1. Floor. + (default = 1/150) + 2. Ceiling. + (default = 120/150) + 3. Ramp speed. + (default = 1, fastest speed) For the stepped ramping mode, there are three menu options: - 1. Floor. (default = 20/150) - 2. Ceiling. (default = 120/150) - 3. Number of steps. (default = 7) + 1. Floor. + (default = 20/150) + 2. Ceiling. + (default = 120/150) + 3. Number of steps. + (default = 7) For the Simple UI mode, there are four menu options. The first three are the same as stepped ramping mode. - 1. Floor. (default = 20/150) - 2. Ceiling. (default = 120/150) - 3. Number of steps. (default = 5) - 4. Turbo style. (default = 0, no turbo) + 1. Floor. + (default = 20/150) + 2. Ceiling. + (default = 120/150) + 3. Number of steps. + (default = 5) + 4. Turbo style. + (default = 0, no turbo) **Default values are different for each model of flashlight. The numbers above are only examples.** -- cgit v1.2.3 From 1d195f9740bf2fbadd360f571ff9fbf411fae1c7 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 12:05:15 -0700 Subject: make clean: don't remove files in arch/dfp/ --- make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make b/make index d0d1a5d..8d3d801 100755 --- a/make +++ b/make @@ -54,8 +54,8 @@ function main() { help ;; clean) - echo 'rm -vf **/*.hex **/*~ **/*.elf **/*.o **/*.cpp' - rm -vf **/*.hex **/*~ **/*.elf **/*.o **/*.cpp + echo 'rm -vf **/*~ hex/*.hex ui/**/*.elf ui/**/*.o ui/**/*.cpp' + rm -vf **/*~ hex/*.hex ui/**/*.elf ui/**/*.o ui/**/*.cpp ;; dfp) shift -- cgit v1.2.3 From 0aeb1b226c10586c8923b818a9dda7d51cab798a Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:00:01 -0700 Subject: initial test to fix branch names and see if actions work --- .github/workflows/compile.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 9b06253..78ca9cc 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,29 +1,34 @@ -name: anduril +name: build all on: push: - branches: [ "main", "actions" ] + branches: [ "trunk", "gretel-actions" ] pull_request: - branches: [ "main" ] + branches: [ "trunk" ] jobs: compile: runs-on: ubuntu-latest steps: + - name: Checkout uses: actions/checkout@master + - name: Requirements run: | - sudo apt-get -qqy update - sudo apt-get -qqy install avr-libc binutils-avr wget gcc-avr unzip + sudo apt -qqy update + sudo apt -qqy install avr-libc binutils-avr gcc-avr wget unzip + - name: Install Device Family Pack run: | ./make dfp + - name: Compile All run: | - ./bin/build-all.sh + ./make echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" + - name: Store Artifacts uses: actions/upload-artifact@master with: -- cgit v1.2.3 From 7bf25607f1f7519b02521b941bfa4690eece44df Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:08:15 -0700 Subject: help CI detect build failures made 'make' and 'build-all.sh' exit with an error on fail, so CI can hopefully detect it... and added an intentional source bug to make it fail for testing purposes --- bin/build-all.sh | 1 + hw/fireflies/arch | 2 +- make | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/build-all.sh b/bin/build-all.sh index 2d443a5..ac8ea98 100755 --- a/bin/build-all.sh +++ b/bin/build-all.sh @@ -66,4 +66,5 @@ echo "===== $PASS builds succeeded, $FAIL failed =====" #echo "PASS: $PASSED" if [ 0 != $FAIL ]; then echo "FAIL:$FAILED" + exit 1 fi diff --git a/hw/fireflies/arch b/hw/fireflies/arch index d16b0f8..dcd026a 100644 --- a/hw/fireflies/arch +++ b/hw/fireflies/arch @@ -1 +1 @@ -attiny85 +attiny69 diff --git a/make b/make index 8d3d801..89e196d 100755 --- a/make +++ b/make @@ -59,7 +59,7 @@ function main() { ;; dfp) shift - ./bin/dfp-install.sh "$@" + exec ./bin/dfp-install.sh "$@" ;; docs) make-docs @@ -79,7 +79,7 @@ function main() { grep -E 'TODO:|FIXME:' **/*.[ch] ;; *) - ./bin/build-all.sh "$@" + exec ./bin/build-all.sh "$@" ;; esac } -- cgit v1.2.3 From 41e479bee5ef2ce73d5c5cde405c6096b1177394 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:11:14 -0700 Subject: fixed intentional error, because CI build-fail test worked correctly --- hw/fireflies/arch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/fireflies/arch b/hw/fireflies/arch index dcd026a..d16b0f8 100644 --- a/hw/fireflies/arch +++ b/hw/fireflies/arch @@ -1 +1 @@ -attiny69 +attiny85 -- cgit v1.2.3 From 6fe353f80cd0d308ec2d05e090082d4e35864d6d Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 13:50:27 -0700 Subject: github actions: cache the Atmel DFP files between runs --- .github/workflows/compile.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 78ca9cc..c6278d3 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -18,9 +18,20 @@ jobs: - name: Requirements run: | sudo apt -qqy update - sudo apt -qqy install avr-libc binutils-avr gcc-avr wget unzip + sudo apt -qqy install avr-libc binutils-avr gcc-avr unzip wget - - name: Install Device Family Pack + - name: Cache Atmel DFPs + id: cache-dfp + uses: actions/cache@v3 + env: + cache-name: cache-dfp-files + with: + path: arch/dfp + # new cache whenever the dfp-install script changes + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('bin/dfp-install.sh') }} + + - name: Install Atmel DFPs + if: steps.cache-dfp.outputs.cache-hit != 'true' run: | ./make dfp -- cgit v1.2.3 From 6e78c50d7c5b5a8a874f962f4cc8229b23f2cc06 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 14:10:22 -0700 Subject: test: is apt-get any faster than apt? --- .github/workflows/compile.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index c6278d3..e3371ec 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -17,8 +17,8 @@ jobs: - name: Requirements run: | - sudo apt -qqy update - sudo apt -qqy install avr-libc binutils-avr gcc-avr unzip wget + sudo apt-get -qqy update + sudo apt-get -qqy install avr-libc binutils-avr gcc-avr unzip wget - name: Cache Atmel DFPs id: cache-dfp @@ -41,7 +41,7 @@ jobs: echo "ARTIFACT_NAME=${GITHUB_WORKFLOW}-${GITHUB_REF_NAME}-$(git rev-parse --short ${GITHUB_SHA})-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}" - name: Store Artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v3 with: name: ${{ env.ARTIFACT_NAME }} if-no-files-found: error -- cgit v1.2.3 From 962b571eac828f1ad334fb043b6265fbf16e6b61 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 5 Nov 2023 14:17:27 -0700 Subject: removed test branch from action triggers (the action works and seems ready to merge) --- .github/workflows/compile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index e3371ec..fabcf31 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -2,7 +2,7 @@ name: build all on: push: - branches: [ "trunk", "gretel-actions" ] + branches: [ "trunk" ] pull_request: branches: [ "trunk" ] -- cgit v1.2.3