689
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
688
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
687
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
686
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
685
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
684
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
683
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
682
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
681
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
680
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
679
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
678
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
677
|
|
fixed bug behind K93_LOCKOUT_KLUDGE which could exit lockout in solid aux mode (also reduced avg standby power by about 15 uA) (also fixed oscillating voltage mode colors, I think)
The bug happened because sometimes sleep LVP would get triggered, because the ADC would read zero under some conditions.
This in turn happened because the ADC needs the MCU to be at least partially awake in order to finish a measurement. So in standby mode, with the MCU only waking up very briefly to send a sleep tick and go back to sleep, the ADC required several cycles (like 375ms to 625ms) to finish a single measurement. This varied depending on how many instructions the MCU executed while it was awake. In the single-color mode, so few instructions were being executed that the ADC seemed to time out and abort its measurement, returning a zero. Then a low voltage warning was sent, which knocked the light back into "Off" mode.
Adding no-op instructions inside the single-color clause was sufficient to prevent the ADC from timing out, because it kept the MCU awake just barely long enough. But it was a kludge, and it still took like half a second to finish a measurement, and the measurements were noisy. It also used more power, because it required keeping the ADC powered on far too long.
This fix puts the MCU into "ADC Noise Reduction" mode instead, when a voltage measurement is needed during sleep. It reduces noise to make measurements more stable... but more importantly, it lets the measurement finish in like 0.5ms instead of 500ms. So it uses less power and isn't dependent on the number of calculations the MCU does during each "sleep tick".
As a bonus, this can also measure voltage much more often, while still using less total energy than before. It was once every 8 seconds, and now it's once per second.
Avg power use in aux low mode, on a D4Sv2: (avg of 30k samples each)
- before: 101 uA - after: 86 uA
|
Selene ToyKeeper |
1 year ago
|
|
|
676
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
675
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
674
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
673
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
672
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
671
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|
670
|
|
|
Selene ToyKeeper |
1 year ago
|
|
|