diff options
| author | Selene ToyKeeper | 2024-03-31 07:22:19 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2024-03-31 07:22:19 -0600 |
| commit | 292af6416ae34d59b2c2c8b6d2197b5a226abd0d (patch) | |
| tree | 8d5c06f7b910f8cc7daf936d903090abe445add1 /fsm | |
| parent | use smooth steps in lockout mode, if enabled (diff) | |
| parent | d3aa: fixed voltage calculation to use 0.02V units instead of 0.025V (diff) | |
| download | anduril-292af6416ae34d59b2c2c8b6d2197b5a226abd0d.tar.gz anduril-292af6416ae34d59b2c2c8b6d2197b5a226abd0d.tar.bz2 anduril-292af6416ae34d59b2c2c8b6d2197b5a226abd0d.zip | |
Merge branch 'emisar-d3aa' into trunk
Added support for new Emisar D3AA torch.
* emisar-d3aa:
d3aa: fixed voltage calculation to use 0.02V units instead of 0.025V
d3aa weak battery test: blink 3x instead of 2x, and omit number readout
weak battery detection: use different thresholds for AA and Li-Ion (also, fixed bug where a totally empty li-ion didn't get limited)
d3aa: got weak battery detection actually working, and not letting the magic smoke out of updi adapters any more (probably)
dammit, got alkaline detection half working and then my flashing adapter died (saving progress here so I can work on a different branch)
d3aa fine-tuning: - new ramp - production style config defaults (simple mode, Hank config) - candle tuning - fixed way-too-fast thermal regulation (might still be a bit fast, but it's a lot better)
d3aa: fixed voltage measurement
d3aa: made it easy to switch between vddio2 and external voltage divider
emisar-d3aa: new model number, since this is a new product line
added initial code for emisar-d3aa torch
Diffstat (limited to 'fsm')
| -rw-r--r-- | fsm/ramping.c | 5 | ||||
| -rw-r--r-- | fsm/ramping.h | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fsm/ramping.c b/fsm/ramping.c index adc8acb..743e619 100644 --- a/fsm/ramping.c +++ b/fsm/ramping.c @@ -57,6 +57,11 @@ inline void set_level_aux_rgb_leds(uint8_t level) { void set_level(uint8_t level) { + #ifdef USE_RAMP_LEVEL_HARD_LIMIT + if (ramp_level_hard_limit && (level > ramp_level_hard_limit)) + level = ramp_level_hard_limit; + #endif + #ifdef USE_JUMP_START // maybe "jump start" the engine, if it's prone to slow starts // (pulse the output high for a moment to wake up the power regulator) diff --git a/fsm/ramping.h b/fsm/ramping.h index c4b7d48..f542bd2 100644 --- a/fsm/ramping.h +++ b/fsm/ramping.h @@ -10,6 +10,9 @@ uint8_t actual_level = 0; // the level used before actual uint8_t prev_level = 0; +#ifdef USE_RAMP_LEVEL_HARD_LIMIT +uint8_t ramp_level_hard_limit = 0; +#endif void set_level(uint8_t level); //void set_level_smooth(uint8_t level); |
