Anyone care to review a large BLF A6 attiny13a firmware mod?

I’ve added reverse mode order and medium press disablement at the cost of the biking strobe mode. Can someone please review this code or point me in the right direction? I’m running it currently on my A6 without issue in any mode combination, but I’m fairly new to working with such constraints. If someone can save 2 bytes in text, small bike strobe can be enabled, and another 10 or so for full bike strobe.

Edit:

Several more features have been added, and I’ve revived full bike strobe.

Features:

1. Mode 0 of Mode group 2 (4 output levels) is now moon instead of “low”
2. Two new options added to the configuration menu:

  • Option 3 is “mode reversal”, which reverses the order of the current mode group
  • Option 4 is “medium press disable”, which disables medium press functionality

3. Config mode has been revamped, and now works just like bistro firmware (blink the config option number, then ‘buzz’ (quick strobe) for a second or so. The config option is set if you short press during the ‘buzz’.
4. Under the hood changes include:

  • Unification of strobe and blink, blink delay duration and maximum brightness have been added as options
  • Flipping of the config/mode_idx eeprom bit so the config is never missed when scanned for
  • toggle() being replaced with a loop in main
  • config bitfield variable containing all config options in the lower register (I will make macros for this down the line as I have time)

Welcome to BLF!
Can’t help you, so let’s hope the smart people chime in :wink:

Thanks Miller!

I’ve figured it out, I moved the mode arrays out of PROGMEM and used some more SRAM (it never peaked over 4 bytes used!).

Now, all functionality is intact, and reverse mode order as well as the ability to disable/enable medium press have been added! Hopefully someone finds it useful.

I did cut out the config stars bit, since it’s entirely configurable via the UI.

I even have room to spare. I think I’m going to try to make it audibly play funkytown via PWM when fast pressed 8 times.

I’ve comitted the code. If anyone has a chance, please give it a shot and tell me how it works!

I’m going to keep working on the attiny13a, my intention is to get as many bistro-like features into it as possible. Temperature regulation may be possible via the capacitor, it’s capacitance changes with temperature relatively consistently on my a6 drivers.