aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-06-17 19:46:02 -0600
committerSelene ToyKeeper2018-06-17 19:46:02 -0600
commit55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb (patch)
tree4f90068fe71369e55c68a527b4d13599345f4c62 /spaghetti-monster
parentStarted adding support for aux LEDs which go out the front instead of lightin... (diff)
downloadanduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.tar.gz
anduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.tar.bz2
anduril-55e75b9da0c435ad89165ef6c0eb38e9dd9c65fb.zip
Made thermal response faster at high levels. Not yet tested.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c19
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 ++;
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.