diff options
| author | Selene ToyKeeper | 2024-03-11 17:51:14 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2024-03-11 17:51:14 -0600 |
| commit | 412df484ddf0650c07da56193bfa906a8647d1dc (patch) | |
| tree | 872a7bb361eff8857758373e8b13366344e3f20a /hw/hank/emisar-d3aa/hwdef.c | |
| parent | d3aa: fixed voltage measurement (diff) | |
| download | anduril-412df484ddf0650c07da56193bfa906a8647d1dc.tar.gz anduril-412df484ddf0650c07da56193bfa906a8647d1dc.tar.bz2 anduril-412df484ddf0650c07da56193bfa906a8647d1dc.zip | |
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)
Diffstat (limited to 'hw/hank/emisar-d3aa/hwdef.c')
| -rw-r--r-- | hw/hank/emisar-d3aa/hwdef.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/hw/hank/emisar-d3aa/hwdef.c b/hw/hank/emisar-d3aa/hwdef.c index a963bc2..e2fd315 100644 --- a/hw/hank/emisar-d3aa/hwdef.c +++ b/hw/hank/emisar-d3aa/hwdef.c @@ -84,17 +84,9 @@ bool gradual_tick_main(uint8_t gt) { PWM1_DATATYPE dac_now = DAC_LVL >> 6; // register is left-aligned PWM1_DATATYPE dac_next = PWM1_GET(gt); - // adjust multiple times based on how far until the next level - // (so it adjusts faster/coarser for big steps) - - int16_t diff = (dac_next - dac_now); - if (diff < 0) diff = -diff; - - // ~70 max DAC levels per ramp step, 1 + (70 >> 3) = max 10 - uint8_t steps; - steps = 1 + (diff >> 3); - for (uint8_t i=0; i<=steps; i++) - GRADUAL_ADJUST_SIMPLE(dac_next, dac_now); + // only adjust 1 dac level, max is 1023 + // (but speed it up with "#define GRADUAL_ADJUST_SPEED 4" elsewhere) + GRADUAL_ADJUST_SIMPLE(dac_next, dac_now); DAC_LVL = dac_now << 6; |
