aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-03-15the ADC sample count doesn't need to be 16-bit any more, and isn't really a ↵Selene ToyKeeper2-3/+4
count any more... ... just a boolean flag for whether this is the first sample or a later sample (so I changed it and reduced the ROM size by ~28 bytes)
2020-03-15removed dead comments and dead codeSelene ToyKeeper1-28/+2
2020-03-15replaced temperature_timer (which wasn't even being used) with a variable ↵Selene ToyKeeper1-27/+43
delay between warnings, so large warnings can remain frequent while small warnings are separated by more time, based on a cumulative error counter which must pass a threshold before the next warning is sent (this is producing good test results so far on D4v2 and D4Sv2)
2020-03-13tried to make thermal code a bit less twitchy...Selene ToyKeeper3-13/+19
it regulates really fast on D4, but once it's stable, the adjustments are too large
2020-02-28went back to continuous lowpass because it had the best noise reductionSelene ToyKeeper2-52/+74
(also, now treating smoothed ADC values as 11-bit, with the lowest 5 bits chopped off to eliminate noise)
2020-02-05brute force method for reducing ADC noise -- average a ridiculous number of ↵Selene ToyKeeper2-20/+14
samples (because, for some reason, even though 64 samples is plenty in a test program, it ends up being extremely erratic when used inside Anduril... and I'm not sure why) also, use 15-bit ADC values instead of 16 bits, in the temperature logic (to help protect against integer overflows) ... but this code still doesn't work well. It regulates down *very* fast, and then gradually rises until the next extra-fast drop-down. :( ... also, tempcheck mode sometimes changes by 4-5 C between readouts, which is worrisome. ... and factory reset is still broken.
2020-02-05still doesn't work, but at least it's a bit less broken than before...Selene ToyKeeper1-8/+12
(ceiling value was all wrong, and the response magnitude was way too big) (also, temperatures here are unsigned, since freezing is about 270 in ADC units)
2020-02-05first pass at a smaller simpler thermal regulation algorithm...Selene ToyKeeper1-75/+52
... doesn't work well, but I'm saving it so I can experiment with other methods and maybe revert back later.
2020-02-05replaced Anduril's gradual adjustment speed code with a smaller simpler versionSelene ToyKeeper1-43/+17
2020-01-30saving state of ADC / WDT refactoring before doing more changes... what ↵Selene ToyKeeper5-76/+59
changed so far: - removed LVP lowpass and thermal regulation lowpass logic; it's probably redundant now - slowed ADC deferred logic timing to 4X per second instead of 16X, because there doesn't seem to be much reason to do it any faster - reduced thermal event rate-limit to just 1 second, for more responsive regulation - added "EV_temperature_okay" signal, to help stop adjustments at an appropriate time instead of going to far - sped up sleep LVP to one measurement every 8 seconds instead of 16, to help the aux LEDs respond to voltage changes faster (effect on standby time is negligible) - make sure the WDT doesn't set the ADC channel or counter... except in standby mode
2020-01-30switched to a pseudo-rolling-average method to reduce noise, set prescaler ↵Selene ToyKeeper1-8/+13
back to 64
2020-01-29increased effective ADC resolution by switching from continuous-lowpass to ↵Selene ToyKeeper1-64/+43
sum-of-discrete-window method
2020-01-29remove truncation noise by adding 0.5 to each resultSelene ToyKeeper1-24/+22
(keeps stable values within ~0.46 to ~0.54 range, so truncated result has no noise)
2020-01-29rewrote ADC code to use a continuous lowpass system on all measurements, to ↵Selene ToyKeeper5-130/+194
eliminate noise and maybe increase precision (thermal code still needs to be rewritten though)
2019-12-17fixed too-slow thermal response (was introduced in the irq-refactor branch)Selene ToyKeeper1-5/+8
2019-12-11added support for Fireflies ROT66 G2 and PL47 G2Selene ToyKeeper2-0/+109
2019-12-04added a compile-time flag to enable/disable momentary mode (suggested by Agro)Selene ToyKeeper1-1/+18
2019-12-04fixed compile errors to handle a couple USE_ flags better:Selene ToyKeeper1-2/+8
- beacon mode off (suggested by Agro) - tenclick shortcut on with thermal regulation off
2019-12-03added a FW3A build with the FET turned off completelySelene ToyKeeper1-0/+36
2019-12-03adjusted lantern tint ramping power correction again, based on measurements ↵Selene ToyKeeper1-1/+1
of the previous attempt
2019-11-29adjusted BLF Lantern (Sofirn LT1) tint ramping power correction factor to ↵Selene ToyKeeper2-1/+8
match production units (also made the factor configurable per build target)
2019-11-24enabled muggle mode again in all build targets, since it fits nowSelene ToyKeeper4-23/+0
2019-11-20fixed unintentional wakeup right after going to sleepSelene ToyKeeper1-2/+2
(by enabling the PCINT slightly sooner, before setting its "handled" flag)
2019-11-19Mateminco MF01S can fit muggle mode again, barelySelene ToyKeeper1-3/+3
2019-11-19reduced build size by a few bytesSelene ToyKeeper2-3/+3
2019-11-19the Q8 can just barely fit muggle mode againSelene ToyKeeper1-3/+3
2019-11-19enabled prevent_reboot_loop() on all builds, to reduce the impact of any ↵Selene ToyKeeper1-5/+7
potential crashes (even though I just fixed the only known bug which could trigger an unintentional reboot)
2019-11-19fixed ADC cycles running 2X as fast as intendedSelene ToyKeeper1-8/+8
2019-11-19cleaned up WDT code a bit, reduced total size,Selene ToyKeeper2-29/+25
fixed bug where ticks_since_last could have the wrong value sometimes, reduced power use in sleep mode very slightly by skipping button-handling code while asleep
2019-11-18fixed issue where button-press-during-sleep could occasionally cause a rebootSelene ToyKeeper1-3/+7
(by turning off PCINT when the light is awake)
2019-11-18added SOS mode to the BLF LT1 Lantern build, because people wanted itSelene ToyKeeper2-7/+44
2019-11-14turned off muggle mode on Q8 and MF01S, to make builds small enough againSelene ToyKeeper2-0/+11
2019-11-14oops, put voltage lowpass on the wrong D4SSelene ToyKeeper2-3/+4
2019-11-14added a lowpass filter for battery voltage measurementsSelene ToyKeeper3-37/+29
(but only on attiny1634 devices, since it costs a bit of space and isn't strictly necessary)
2019-11-14fixed factory reset (wasn't running interrupt logic since it's deferred now)Selene ToyKeeper3-12/+11
(also fixed issue where nice_delay_ms() was aborted during setup()) (and adjusted the timing to make factory reset similar to the speed it was before this change)
2019-11-14fixed ADC code; measures and behaves correctly now, and is easier to read...Selene ToyKeeper3-41/+41
... but factory reset's auto-calibrate still doesn't get the right values for some reason (manual calibration works, but not auto)
2019-11-14started refactoring ADC code to split voltage and temperature into their own ↵Selene ToyKeeper2-212/+226
functions
2019-11-14refactored how interrupts work...Selene ToyKeeper10-38/+108
set a flag and return immediately, then handle the actual logic later during a less-critical code path Enables smarter responses to standby wakeups. Seems to fix missed button presses during standby, and most of the too-fast sleep ticks. Also eliminated waits from button state measurement, so it can happen easier during standby. (also eliminates the chance of an infinite loop on extra-noisy hardware) Also might improve timing-sensitive interrupts like attiny85 PWM channel 4, or a PWM-DSM hybrid technique I'd like to try. BUT this change also appears to break the thermal sensor, so that needs to be fixed.
2019-11-13fixed some compile issues related to delay_4ms()Selene ToyKeeper3-2/+2
2019-10-02made lantern's muggle mode brighter (matches default stepped ramp level 4 of 5)Selene ToyKeeper1-0/+3
and made the floor slightly lower (almost as low as level 1 of 5) because this light doesn't run hot enough for the previous limit to make sense (was roughly step 2.9 of 5)
2019-10-02added a default version.h for people who don't use the build scriptSelene ToyKeeper1-0/+4
2019-09-28after safety ramp-down, if the button remains stuck, lock the lightSelene ToyKeeper1-1/+9
2019-09-24added a version check function on 15+ clicks from off, added a safety ↵Selene ToyKeeper4-0/+52
ramp-down if button is held too long at ceiling (also removed muggle mode from a couple build targets because it doesn't fit, not enough ROM)
2019-09-24sped up blink_digit() a little bit, because it was annoyingly slowSelene ToyKeeper1-3/+4
2019-09-24made the maximum number of clicks 15 instead of 14Selene ToyKeeper1-1/+1
2019-09-15added some ideas for stuff to do, updated the UI diagram to show the stepped ↵Selene ToyKeeper3-49/+195
ramp mode differently
2019-09-07slowed down rainbow RGB mode, added a ramp-down on stuck-button for safety ↵Selene ToyKeeper1-1/+7
purposes
2019-09-06added button LED support to D4v2Selene ToyKeeper5-5/+64
(in a way which doesn't break backward compatibility... ... but it really needs some refactoring to reduce code duplication)
2019-08-29added Emisar D4S V2 supportSelene ToyKeeper2-0/+73
2019-08-26just cleaning up some commentsSelene ToyKeeper1-7/+1