diff options
| author | Selene ToyKeeper | 2018-06-17 19:46:02 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-06-17 19:46:02 -0600 |
| commit | 55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb (patch) | |
| tree | 4f90068fe71369e55c68a527b4d13599345f4c62 | |
| parent | Started adding support for aux LEDs which go out the front instead of lightin... (diff) | |
| download | anduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.tar.gz anduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.tar.bz2 anduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.zip | |
Made thermal response faster at high levels. Not yet tested.
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index b64d487..ca8a138 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -29,6 +29,11 @@ #define USE_THERMAL_REGULATION #define DEFAULT_THERM_CEIL 50 #define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to +#ifdef MAX_Nx7135 +#define THERM_DOUBLE_SPEED_LEVEL MAX_Nx7135 // throttle back faster when high +#else +#define THERM_DOUBLE_SPEED_LEVEL (RAMP_LENGTH*4/5) // throttle back faster when high +#endif #define USE_SET_LEVEL_GRADUALLY #define BLINK_AT_CHANNEL_BOUNDARIES //#define BLINK_AT_RAMP_FLOOR @@ -586,12 +591,22 @@ uint8_t steady_state(EventPtr event, uint16_t arg) { // make thermal adjustment speed scale with magnitude if (arg & 1) return MISCHIEF_MANAGED; // adjust slower // [int(62*4 / (x**0.8)) for x in (1,2,4,8,16,32,64,128)] - uint8_t intervals[] = {248, 142, 81, 46, 26, 15, 8, 5}; + //uint8_t intervals[] = {248, 142, 81, 46, 26, 15, 8, 5}; + // [int(62*4 / (x**0.9)) for x in (1,2,4,8,16,32,64,128)] + //uint8_t intervals[] = {248, 132, 71, 38, 20, 10, 5, 3}; + // [int(62*4 / (x**0.95)) for x in (1,2,4,8,16,32,64,128)] + uint8_t intervals[] = {248, 128, 66, 34, 17, 9, 4, 2}; uint8_t diff; static uint8_t ticks_since_adjust = 0; ticks_since_adjust ++; if (target_level > actual_level) diff = target_level - actual_level; - else diff = actual_level - target_level; + else { + diff = actual_level - target_level; + // if we're on a really high mode, drop faster + if (actual_level >= THERM_DOUBLE_SPEED_LEVEL) { + diff <<= 1; + } + } uint8_t magnitude = 0; while (diff) { magnitude ++; |
