aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-06-30 19:25:05 -0600
committerSelene ToyKeeper2018-06-30 19:25:05 -0600
commit3fd042cfc13c5cddc79b5a6b38e5c50e4d24c7d6 (patch)
tree10d09beb38fa18f191ab412130f390258e3416b7
parentJust in case, overheating in muggle mode triggers an immediate drop to the fl... (diff)
downloadanduril-3fd042cfc13c5cddc79b5a6b38e5c50e4d24c7d6.tar.gz
anduril-3fd042cfc13c5cddc79b5a6b38e5c50e4d24c7d6.tar.bz2
anduril-3fd042cfc13c5cddc79b5a6b38e5c50e4d24c7d6.zip
Fixed thermal regulation bug, where it used the wrong target to determine adjustment speed.
Added a THERM_HARD_TURBO_DROP option, but after fixing the previous bug I'm not sure it's really needed. Decreased default temperature ceiling to 45 C (was 50).
-rw-r--r--spaghetti-monster/anduril/anduril.c27
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4.h4
-rw-r--r--spaghetti-monster/anduril/cfg-fw3a.h6
3 files changed, 34 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index e79d568..0766361 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -28,7 +28,7 @@
#define USE_LVP // FIXME: won't build when this option is turned off
#define USE_THERMAL_REGULATION
-#define DEFAULT_THERM_CEIL 50
+#define DEFAULT_THERM_CEIL 45
#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
@@ -590,6 +590,13 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
if ((arg & 1) && (actual_level < THERM_DOUBLE_SPEED_LEVEL)) {
return MISCHIEF_MANAGED; // adjust slower when not a high mode
}
+ #ifdef THERM_HARD_TURBO_DROP
+ else if ((! (actual_level < THERM_DOUBLE_SPEED_LEVEL))
+ && (actual_level > gradual_target)) {
+ gradual_tick();
+ }
+ else {
+ #endif
// [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};
// [int(62*4 / (x**0.9)) for x in (1,2,4,8,16,32,64,128)]
@@ -599,13 +606,15 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
uint8_t diff;
static uint8_t ticks_since_adjust = 0;
ticks_since_adjust ++;
- if (target_level > actual_level) diff = target_level - actual_level;
+ if (gradual_target > actual_level) diff = gradual_target - actual_level;
else {
- diff = actual_level - target_level;
+ diff = actual_level - gradual_target;
}
uint8_t magnitude = 0;
+ #ifndef THERM_HARD_TURBO_DROP
// if we're on a really high mode, drop faster
if (actual_level >= THERM_DOUBLE_SPEED_LEVEL) { magnitude ++; }
+ #endif
while (diff) {
magnitude ++;
diff >>= 1;
@@ -617,6 +626,9 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
ticks_since_adjust = 0;
}
//if (!(arg % ticks_per_adjust)) gradual_tick();
+ #ifdef THERM_HARD_TURBO_DROP
+ }
+ #endif
#endif
return MISCHIEF_MANAGED;
}
@@ -630,6 +642,15 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
delay_4ms(2);
set_level(foo);
#endif
+ #ifdef THERM_HARD_TURBO_DROP
+ if (actual_level > THERM_DOUBLE_SPEED_LEVEL) {
+ #ifdef USE_SET_LEVEL_GRADUALLY
+ set_level_gradually(THERM_DOUBLE_SPEED_LEVEL);
+ #else
+ set_level(THERM_DOUBLE_SPEED_LEVEL);
+ #endif
+ } else
+ #endif
if (actual_level > MIN_THERM_STEPDOWN) {
int16_t stepdown = actual_level - arg;
if (stepdown < MIN_THERM_STEPDOWN) stepdown = MIN_THERM_STEPDOWN;
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4.h b/spaghetti-monster/anduril/cfg-emisar-d4.h
index d17e2b0..a90d318 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4.h
@@ -12,3 +12,7 @@
#define MAX_1x7135 65
#define HALFSPEED_LEVEL 14
#define QUARTERSPEED_LEVEL 5
+
+// optional, makes initial turbo step-down faster so first peak isn't as hot
+//#define THERM_HARD_TURBO_DROP
+
diff --git a/spaghetti-monster/anduril/cfg-fw3a.h b/spaghetti-monster/anduril/cfg-fw3a.h
index 3df426d..2790086 100644
--- a/spaghetti-monster/anduril/cfg-fw3a.h
+++ b/spaghetti-monster/anduril/cfg-fw3a.h
@@ -16,3 +16,9 @@
#define HALFSPEED_LEVEL 14
#define QUARTERSPEED_LEVEL 5
+#ifdef THERM_DOUBLE_SPEED_LEVEL
+#undef THERM_DOUBLE_SPEED_LEVEL
+#endif
+#define THERM_DOUBLE_SPEED_LEVEL MAX_Nx7135
+// optional, makes initial turbo step-down faster so first peak isn't as hot
+//#define THERM_HARD_TURBO_DROP
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.