Skip to content
/ tyrfing Public

Firmware for flashlights using loneoceans attiny1616 drivers

Notifications You must be signed in to change notification settings

simmsb/tyrfing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f53529a · Mar 22, 2025

History

36 Commits
Sep 13, 2024
Jan 28, 2024
Mar 22, 2025
Nov 16, 2024
Nov 16, 2024
Jan 28, 2024
Jan 28, 2024
Jan 28, 2024
Nov 16, 2024
Nov 16, 2024
Mar 10, 2024
Nov 16, 2024
Mar 22, 2025
Mar 22, 2025
Nov 16, 2024
Mar 22, 2025
Feb 21, 2024
Mar 22, 2025
Sep 13, 2024

Repository files navigation

Flashlight firmware, written in rust

torches.mp4

This is flashlight firmware for the lume1-6af (attiny1616), written in Rust. It supports thermal and voltage regulation that prevents LED and battery damage by reducing output as temperature increases, and prevents usage when the battery voltage is too low.

The UI is implemented using async rust, which makes adding new modes of operation fairly trivial.

The UI and features are inspired by the Andúril firmware

Current UI

This might be wrong, the source code is here

Loading
stateDiagram-v2
    [*] --> Locked

    state Locked

    Locked --> Unlocked : 3c
    Unlocked --> Locked : 4c
    Unlocked --> Locked : Timeout


    state Unlocked {
        [*] --> Ramping : 1c
        [*] --> Ramping : 1h (low start)
        
        state Ramping {
            [*] --> [*] : 1h (increase brightness)
            [*] --> [*] : 2h (decrease brightness)
        }
        
        Ramping --> [*] : 1c

        [*] --> Fading : 2h
        
        state Fading {
            [*] --> [*] : 1h (increase brightness)
            [*] --> [*] : 2h (decrease brightness)
            [*] --> [*] : 3h (increase timeout)
        }
        
        Fading --> [*] : 1c

        [*] --> Strobing : 3h
        
        state Strobing {
            [*] --> [*] : 1h (increase brightness)
            [*] --> [*] : 2h (decrease brightness)
            [*] --> [*] : 3h (decrease period)
            [*] --> [*] : 4h (increase period)
        }
        
        Strobing --> [*] : 1c

    }

Thanks

This project relies on and makes modifications to:

EMBASSY on an attiny1616

This is some messing around with embassy on AVR (attiny1616)

The time driver ticks at 64hz and I've modified embassy to use a u32 tick counter, which at 64hz won't overflow for just enough time for this to be useful to me

About

Firmware for flashlights using loneoceans attiny1616 drivers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published