aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-09-22Added FW3A driver support to FSM and Anduril.Selene ToyKeeper2-20/+36
Made lightning storm mode look a bit more like real lightning. Minor refactoring on how single-option config modes save state.
2017-09-10Fixed a bug in gradual_tick(), I think.Selene ToyKeeper2-3/+4
It was off by one, and caused actual_level to be off by one, which caused other parts of the code to do weird things... - end-of-ramp blink would happen repeatedly. - ramping up went slower (or not at all, with gradual_tick on each tick) - would sometimes trigger underheating code at moon level, and then glide up to the minimum regulation floor
2017-09-10Applied recent changes to UI description text.Selene ToyKeeper1-7/+16
2017-09-10Moved strobes from 5 clicks to "click, click, long-click".Selene ToyKeeper2-8/+28
Moved momentary mode from 6 clicks to 5 clicks.
2017-09-10Adjusted thermal regulation based on results of some handheld runtime tests.Selene ToyKeeper1-2/+2
It was bouncing before, and now it's not. (cut response magnitude in half, increased width of null zone)
2017-09-10Made thermal regulation slightly more prediction-heavy, less noisy at stable ↵Selene ToyKeeper1-8/+11
state, and slightly smaller. Added a bit of overflow protection since I think I saw it overflow with the prediction weight increased. Uses immediate temperature (instead of avg) for lowpass reset, to make it less noisy at stable state. (more trigger-happy reset switch biases it toward inaction) Avoid using volatile var, to reduce space. Overflow prevention also caps the maximum adjustment step, which should slightly help prevent overshooting the target.
2017-09-09Rewrote gradual_tick(). Is smaller, better, and safer now.Selene ToyKeeper2-118/+30
Decreased gradual adjustment speed again to make thermal regulation less stair-stepped.
2017-09-09Reworked thermal regulation.Selene ToyKeeper3-31/+60
Now actually works on turbo (was previously emitting "temp low" instead of "temp high" while in direct-drive, probably due to an overflow). Made stepdown work based on an average of the last few temperature predictions instead of just the most recent one. (reduced noise sensitivity) Made each temperature sample based on 8 measurements instead of 4, to reduce noise. Made standby mode re-init thermal measurement arrays, to avoid weird behavior next time light is used. Reduced fixed-point precision to avoid overflows. Reduced prediction strength to encourage stepping down faster while hot. (unfortunately also steps down later, I think, if it wasn't already hot) Not totally happy with new algorithm, but it's the least crappy of a whole bunch of things I tried. (for example, a PID approach with correction based mostly on I... didn't work very well) (taking an average of the last few predictions is very similar though, and works) (but the result is still kind of meh) Saving this so I'll have a functional base next time I try to improve it.
2017-09-09Made thermal regulation adjust smoothly (1 PWM step at a time) to make ↵Selene ToyKeeper3-4/+190
adjustments less noticeable. Added set_level_gradually() and gradual_tick() to ramping lib. Not terribly happy with it yet, but it at least works in practice. Added extra thermal regulation checks because I was running into stupid behavior in edge cases. Increased lowest thermal stepdown level to MAX_LEVEL/3 because it was going down way too low before. (is still pretty low, but not quite as bad)
2017-09-09Made "off" mode more vigilant about staying off.Selene ToyKeeper2-4/+16
2017-09-05Added momentary(ish) moon mode to lockout state.Selene ToyKeeper1-4/+24
Made LVP step down in smaller steps.
2017-09-03Got the 4th PWM channel to work, ish. (channel 4 is inverted though)Selene ToyKeeper12-78/+81
Moved go_to_suspend thing into main() instead of making each UI handle that during loop(). Made default_state() optional. Fixed bug where battcheck and other number readouts could interfere with the state which interrupted them. (they would sometimes turn the LED off after the new state had already started) Updated darkhorse's moon levels to match new ramp on D4 hardware.
2017-09-01Added UI2. UI2 is weird.Selene ToyKeeper1-5/+86
Not sure I got everything the same; will have to try UI2 on my actual Meteor to see how it works.
2017-08-31Started a Meteor M43 clone UI.Selene ToyKeeper4-1/+587
So far, UI1 and battcheck both work. UI2 and UI3 and other blinkies aren't implement yet. Added 6-bar battcheck style to match Meteor (ish). Increased maximum number of clicks to 12, because WTF. If your UI needs 12 clicks, what are you even doing in life?
2017-08-30Reorganized FSM files, one dir per UI.Selene ToyKeeper7-0/+1
2017-08-30Added a simpler and more accurate Baton UI clone.Selene ToyKeeper1-0/+202
Basically, took out the party strobe and added a lockout mode instead.
2017-08-30Replaced FSM_*_LAYOUT with FSM_*_DRIVER because I think it makes more sense.Selene ToyKeeper6-5/+10
Made momentary.c compile again. Updated fsm-main to use whichever delay function is available.
2017-08-30Updated anduril.txt to match current code.Selene ToyKeeper1-12/+16
2017-08-30Made event handling a bit more reliable while asleep.Selene ToyKeeper1-1/+3
(was sometimes having difficulty getting out of soft lockout mode)
2017-08-28Added goodnight mode. Rearranged blinkies in battcheck group.Selene ToyKeeper1-11/+58
2017-08-28Forgot to update the UI text file for lightning storm mode.Selene ToyKeeper1-2/+7
2017-08-28Added lightning storm mode.Selene ToyKeeper1-6/+70
2017-08-28just ideas and minor cleanupSelene ToyKeeper2-3/+16
2017-08-28Adjusted default ramp values for general-purpose use.Selene ToyKeeper1-3/+3
2017-08-28Fixed a crash when user presses the button more times than the UI supports.Selene ToyKeeper1-1/+1
(need to leave room for a trailing 0 in the array, oops)
2017-08-28Added thermal config mode... but I'm not sure if it's the right UI for this ↵Selene ToyKeeper3-3/+45
or not.
2017-08-28Added beacon mode and beacon config mode.Selene ToyKeeper2-10/+83
Renamed ramp_config_mode to ramp_config_state.
2017-08-27UI description up-to-date now.Selene ToyKeeper1-13/+20
2017-08-27Fixed a bug where sometimes the light wouldn't respond for a second or so ↵Selene ToyKeeper1-0/+4
after connecting power. (spurious events were detected at boot, and previously had to time out before it would respond)
2017-08-27Use different speed values for party and tactical strobes.Selene ToyKeeper1-11/+13
2017-08-27Fixed bug: double-click from off didn't *really* go to the top of the ramp.Selene ToyKeeper1-1/+1
2017-08-27Remembered to put the thermal ceiling back at a sane value.Selene ToyKeeper2-2/+7
UI idea updates.
2017-08-27Added bike flasher.Selene ToyKeeper2-24/+63
2017-08-27Adjusted default 2-channel 150-step ramp to start at 1/255.Selene ToyKeeper1-1/+6
(this makes the newly-configurable moon mode able to work on pretty much any hardware)
2017-08-27Now remembers ramp and strobe settings after battery change.Selene ToyKeeper2-19/+48
Also, set new defaults for ramping: - ~50% power maximum - 0.3 lm min for smooth ramping, 10 lm min for discrete ramping
2017-08-27Made ramp config mode significantly easier to use.Selene ToyKeeper2-59/+50
Added delays around each step. Fixed wrong number of blinks for each option.
2017-08-27Ramp config mode actually works now...Selene ToyKeeper4-23/+196
Added EV_reenter_state event to indicate an obscuring state was popped off the stack and the underlying one is now on top again.
2017-08-27Reduced ROM size, simplified logic, made sure discrete ramp won't overflow ↵Selene ToyKeeper1-53/+27
outside uint8_t range.
2017-08-27Made discrete ramping to work significantly better.Selene ToyKeeper2-22/+89
Added momentary mode. Can only be exited by disconnecting power. Rearranged some mappings from off to other states.
2017-08-27Added TICKS_PER_SECOND because it's handy to avoid hardcoding the WDT speed ↵Selene ToyKeeper1-0/+2
in UI code.
2017-08-27Started on Anduril, a Narsil-inspired UI.Selene ToyKeeper2-0/+532
2017-08-27Made it easier to configure the maximum number of clicks it'll try to count ↵Selene ToyKeeper1-1/+57
in one sequence. (use #define MAX_CLICKS 5, for example) Keeps data sizes from being excessively large without having to edit FSM sources per UI.
2017-08-26Revert DarkHorse back to no wear-levelling.Selene ToyKeeper1-15/+15
It's smaller, and WL is probably not needed for this UI. I only converted it as a test, and it worked, so ... woot.
2017-08-26Made wear-levelling work. Takes a bunch of extra ROM though.Selene ToyKeeper3-21/+63
Also, I've only tested it a tiny amount.
2017-08-26Added eeprom load/save API (no wear levelling yet), verified it works in ↵Selene ToyKeeper5-1/+179
DarkHorse.
2017-08-26Avoid suspending at weird times by deferring the call to standby mode.Selene ToyKeeper2-24/+32
Turned strobe into a function to avoid repeating code, and made it tolerate interruption better. Got rid of delay after battcheck, since it caused problems if the user didn't wait long enough before trying to turn the light back on.
2017-08-26Fixed bug: strobes could interfere with hold-from-off next time light was used.Selene ToyKeeper1-20/+24
(because it'd enter standby mode during the strobe pulse, then continue the flow at next activation by turning the light off) Replaced bare return values with ones defined in the FSM library.
2017-08-26Made DarkHorse always start at low when holding the button, like a real ↵Selene ToyKeeper1-24/+19
ZebraLight does. (previously ramped up one mode instead of resetting to low each time)
2017-08-26Forgot to handle beacon/strobe in LVP earlier.Selene ToyKeeper1-7/+4
2017-08-26Added beacons/strobes to DarkHorse.Selene ToyKeeper3-7/+64
Added a way to explicitly cancel the current "nice" delay without changing state.