ToyKeeper / anduril

Anduril 2 Flashlight Firmware and FSM UI Toolkit
GNU General Public License v3.0
199 stars 48 forks source link

Anduril Flashlight Firmware + FSM Flashlight UI Toolkit

Anduril is a user interface for flashlights. It is written with FSM, a UI toolkit for flashlights.

What is FSM? The "SM" means "Spaghetti Monster", and the "F" can be any F word 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 to use it are:

For more in-depth use, read its user manual for full details.

If you want to know what changed recently, check the ChangeLog.

For info about hardware-specific features, like what the channel modes are on multi-channel lights, browse into the hw/ directories to find the hardware model and any hardware-specific documentation.

Flashing Firmware

Get the latest updates by flashing new firmware!

A few things are needed to flash firmware:

One particularly useful guide is at https://anduril.click/ .

More info about installing flashing programs is below, in Flashing Programs.

Compiling

The firmware can be deeply customized by modifying it and compiling your own versions, and this is encouraged.

To compile the firmware, it is strongly recommended that you use a Linux computer, ideally running Debian or Ubuntu (but almost any distro should work). Virtual machines work well, such as running WSL inside Windows. There is also a Docker container available (TODO: add link(s) here), if that is more convenient.

Prerequisites:

Building

Use the make script included in this repo. Run ./make --help for details about how to use it. In most cases though, you should be able to just run ./make by itself to compile all available build targets. Or give it a search term to limit builds to only a few, like ./make hank boost to build all 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 by placing 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

Usually avrdude installs in a single command:

sudo apt install avrdude

PyMCUprog

If you use pymcuprog to flash firmware, a few extras are needed:

sudo apt install python3 python3-pip python3-venv
python3 -m venv .venv
source .venv/bin/activate
pip install pymcuprog

You'll need to source .venv/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...