aboutsummaryrefslogtreecommitdiff
path: root/fsm/ramping.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-03-26d3aa: got weak battery detection actually working,Selene ToyKeeper1-1/+1
and not letting the magic smoke out of updi adapters any more (probably) The alkaline detection might be a little too lenient though; it could potentially fail to activate limits when the cell is completely full or stronger than an average alkaline. One of my test cells measured at 72 / 75, so if it was just a little stronger it'd pass... but most alkalines I tried were in the 40 to 60 range and failed easily. OTOH, if I make it easier to fail, it's likely to trip on normal li-ion cells, and I don't want that. So as a future enhancement idea, maybe it should have a smaller sag threshold for AA and a larger threshold for li-ion. That would reduce false negatives for AA, while still preventing false positives for li-ion.
2024-03-25dammit, got alkaline detection half working and then my flashing adapter diedSelene ToyKeeper1-0/+3
(saving progress here so I can work on a different branch)
2023-11-02reorganized project files (part 1)Selene ToyKeeper1-0/+0
(just moved files, didn't change the contents yet, and nothing will work without updating #includes and build scripts and stuff)
2023-10-26converted Sofirn LT1-t1616 to new API, using SiteRelEnby's branch for referenceSelene ToyKeeper1-1/+3
(needs further updates though, to improve ramping, since this version is basically a straight conversion of the old t85 code with 8-bit ramps)
2023-08-25started splitting set_level(0) into its own set_level_zero(), andSelene ToyKeeper1-0/+1
made USE_AUX_RGB_LEDS_WHILE_ON work more like the old indicator LEDs, where it gets set automatically with set_level() Using set_level_zero() reduces space used by channel modes, and simplifies code for each mode's set_level_*() functions. I measured about 220 bytes less in the emisar-d4k-3ch build this way, while also reducing the chance of bugs.
2023-08-03converted all K9.3 builds and D4Sv2-tintramp-fet (now emisar-2ch-fet)Selene ToyKeeper1-0/+6
to multi-channel, and removed old K9.3 builds which aren't relevant any more, and old D4Sv2-tintramp builds
2023-07-10refactored how channel modes are defined, and converted emisar-2ch buildSelene ToyKeeper1-82/+3
2023-05-30gradual adjustments: handle 0-to-255 in one step on the way up too, not just ↵Selene ToyKeeper1-1/+1
down
2023-05-02post-off voltage display: use low brightness when torch was at moon level ↵Selene ToyKeeper1-0/+2
before, and skip the voltage display after UI actions which didn't change the mode (like "Off -> 7C" to change aux LED settings)
2023-04-29Noctigon KR4: updated to use new channel systemSelene ToyKeeper1-0/+7
(also tweaked D4v2 build to match KR4 as much as possible) (also added Extended Simple UI to Hank's config)
2023-04-25updated D4Sv2-tintramp -> Emisar 2-channel build target ...Selene ToyKeeper1-12/+1
... and reworked how gradual_tick() works ... and updated LT1S Pro to use new method
2023-04-17made "Ramp 3H" do momentary turbo if current channel mode has no argsSelene ToyKeeper1-2/+6
2023-04-17switched the rest of FSM + Anduril to use SPDX license headersSelene ToyKeeper1-19/+3
instead of full GPL headers (or all too often, nothing at all) There are a few "FIXME" entries where I'm not sure about the correct copyright.
2023-04-16reduced ROM by ~600 bytes by moving all eeprom config values to a "cfg" structSelene ToyKeeper1-32/+51
(this also made some parts of the code cleaner)
2023-04-14LT1S: added thermal regulationSelene ToyKeeper1-1/+40
... and a bunch of gradual_tick functions ... and abstracted out some of the tint calculations ... and moved some UI settings into cfg.h
2023-04-14LT1S Pro: added dynamic PWM (much better low modes!)Selene ToyKeeper1-1/+1
2023-04-13refactor progress checkpoint ... got Sofirn LT1S Pro and Emisar D4v2 workingSelene ToyKeeper1-90/+106
with the new channel mode system ... but there's a lot more left to do
2021-10-31added "200%" turbo on tint-ramping lights: D4S and LT1Selene ToyKeeper1-17/+17
Normal ramp from 0% to 100% power on levels 1 to 130, then 101% to 200% power at levels 131 to 150 using both channels at maximum for turbo. When either channel would go over 100%, the extra spills over to the other channel.
2021-09-10fixed K9.3 builds (oops, new update_tint() needed to be compiled out for K9.3)Selene ToyKeeper1-1/+1
2021-09-08got D4Sv2 tint ramping to work, with dynamic PWM (PFM)Selene ToyKeeper1-0/+8
and (maybe) thermal regulation (untested) (also broke BLF LT1 in the process; need to fix that now) Rewrote how tint ramping works, so it provides a virtual "PWM1_LVL" for other code to use, and it translates that internally into actual hardware controls. This should, in theory, allow smooth thermal regulation (gradual_tick) to work on tint-ramp lights.
2021-08-23moved jump start into FSM so it'll be more universal and the app won't need ↵Selene ToyKeeper1-0/+10
special clauses (also adjusted KR4 jump start levels a bit)
2021-08-12got PFM / dynamic PWM actually working on Noctigon KR4Selene ToyKeeper1-0/+8
(and also added "jump start moon" to it) (and generally finished adding dynamic PWM support to FSM)
2020-10-16start tint at 0 instead of 128 on lights with toggle instead of rampSelene ToyKeeper1-0/+4
2020-07-30reduced ROM another 12+6 bytes with more non-volatile varsSelene ToyKeeper1-1/+1
(because they don't need to be volatile any more)
2020-07-29reduced ROM size 56 bytes by making actual_level non-volatileSelene ToyKeeper1-1/+1
(seems unnecessary now; doesn't change in the middle of an event handler any more)
2019-08-06un-hardcoded 255 as the highest PWM level, and used a "PWM_TOP" value insteadSelene ToyKeeper1-0/+3
(should make gradual adjustments work better on devices with more than 8 bits of PWM resolution)
2019-08-05fixed weird ramp behavior on D1S v2 (by trusting the compiler more)Selene ToyKeeper1-1/+4
2019-07-30fsm-ramping: made it possible to change bit depth of PWM values (8-bit or ↵Selene ToyKeeper1-23/+35
16-bit)
2019-05-14added tint ramping power correction for middle tintsSelene ToyKeeper1-0/+1
(it actually needs a surprisingly large correction factor)
2018-12-19configured lantern stepped ramp and button LED mode, set default tint to 128 ↵Selene ToyKeeper1-1/+1
(balanced)
2018-09-13Added tint ramping. Not tested yet. Also added BLF Lantern build target.Selene ToyKeeper1-0/+4
2018-06-27Made high levels regulate down even faster. Added missing save_config() at ↵Selene ToyKeeper1-8/+8
the end of, um, config modes. Fixed ramp table indentation.
2018-06-27Move driver-specific ramp tables into the driver's config file.Selene ToyKeeper1-25/+17
Added a method to allow driver configs to override default ramp tables.
2018-06-24Initial D4S support for Anduril. (but only the parts which can't be public yet)Selene ToyKeeper1-0/+20
2018-05-01Added BLF GT 150-level ramp. Is a bit of a mess though.Selene ToyKeeper1-11/+26
2017-12-11Working toward a FW3A release now. Made strobes use Nx7135 (when available) ↵Selene ToyKeeper1-1/+5
instead of FET. Added some ideas. Simplified some syntax.
2017-09-26Added dynamic underclocking to FSM, instead of doing it manually in Anduril.Selene ToyKeeper1-0/+2
2017-09-24Cut moon power from ~4mA to ~2.5mA by running clock at half speed on very ↵Selene ToyKeeper1-1/+1
low modes. Adjusted default FET+1 ramp to compensate for speed bump. Added define(s) for whether to blink at ramp floor/ceiling/channel edges. Lowered default moon level to 1, since slower speed makes it brighter and more stable.
2017-09-22Added FW3A driver support to FSM and Anduril.Selene ToyKeeper1-6/+6
Made lightning storm mode look a bit more like real lightning. Minor refactoring on how single-option config modes save state.
2017-09-09Made thermal regulation adjust smoothly (1 PWM step at a time) to make ↵Selene ToyKeeper1-0/+7
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-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-24Added a ramping UI example.Selene ToyKeeper1-6/+79
Added ramping support in general.
2017-08-19Renamed from RoundTable to SpaghettiMonster (FSM).Selene ToyKeeper1-1/+1
2017-08-18Some early ideas for Round Table. Nothing close to compile-able yet.Selene ToyKeeper1-15/+9
2017-03-26Fixed a compiler warning about tk-random.h.Selene ToyKeeper1-1/+4
2015-10-12Made pgm_rand() more erratic (beginning of PROGMEM is boring for this purpose),Selene ToyKeeper1-2/+3
made random strobe smaller and better-looking.
2015-10-12Oops, forgot to add tk-random header.Selene ToyKeeper1-0/+28