aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-06-27 03:40:34 -0600
committerSelene ToyKeeper2018-06-27 03:40:34 -0600
commit5391d0364c37013845b83c8dec2862f317fce0fa (patch)
treed04815372408fbfc8e23467fd504f0cc8c3735e3 /spaghetti-monster
parentmerged FSM upstream changes (diff)
downloadanduril-5391d0364c37013845b83c8dec2862f317fce0fa.tar.gz
anduril-5391d0364c37013845b83c8dec2862f317fce0fa.tar.bz2
anduril-5391d0364c37013845b83c8dec2862f317fce0fa.zip
Ramp down even faster on high modes. Actually save to eeprom after config modes.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/rampingiosv3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/rampingiosv3.c b/spaghetti-monster/anduril/rampingiosv3.c
index e4fae2d..1afcbb0 100644
--- a/spaghetti-monster/anduril/rampingiosv3.c
+++ b/spaghetti-monster/anduril/rampingiosv3.c
@@ -33,7 +33,7 @@
#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
+#define THERM_DOUBLE_SPEED_LEVEL (RAMP_SIZE*4/5) // throttle back faster when high
#endif
#ifdef USE_THERMAL_REGULATION
#define USE_SET_LEVEL_GRADUALLY // isn't used except for thermal adjustments
@@ -541,6 +541,8 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
diff = actual_level - target_level;
}
uint8_t magnitude = 0;
+ // if we're on a really high mode, drop faster
+ if (actual_level >= THERM_DOUBLE_SPEED_LEVEL) { magnitude ++; }
while (diff) {
magnitude ++;
diff >>= 1;
@@ -809,6 +811,7 @@ uint8_t config_state_base(EventPtr event, uint16_t arg,
else {
// TODO: blink out some sort of success pattern
savefunc();
+ save_config();
//set_state(retstate, retval);
pop_state();
}