diff options
| author | Selene ToyKeeper | 2020-03-16 03:33:51 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-03-16 03:33:51 -0600 |
| commit | b7f6dd21c396d1431e8864158d1868620ae334d6 (patch) | |
| tree | 055363b8835003a34e5dda823e785ea298c66c2d /spaghetti-monster/werner/werner.c | |
| parent | merged some misc fixes from pakutrai, cleaned up comments, removed unused sym... (diff) | |
| download | anduril-b7f6dd21c396d1431e8864158d1868620ae334d6.tar.gz anduril-b7f6dd21c396d1431e8864158d1868620ae334d6.tar.bz2 anduril-b7f6dd21c396d1431e8864158d1868620ae334d6.zip | |
fixed a few things in ramping-ui, rampingiosv3, and werner's UI
(just copied a few updates from anduril, particularly regarding FSM's "temperature" variable)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/werner/werner.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/spaghetti-monster/werner/werner.c b/spaghetti-monster/werner/werner.c index 7c47cd7..4159fc6 100644 --- a/spaghetti-monster/werner/werner.c +++ b/spaghetti-monster/werner/werner.c @@ -467,14 +467,15 @@ void thermal_config_save() { // calibrate room temperature val = config_state_values[0]; if (val) { - int8_t rawtemp = (temperature >> 1) - therm_cal_offset; + int8_t rawtemp = temperature - therm_cal_offset; therm_cal_offset = val - rawtemp; + reset_thermal_history = 1; // invalidate all recent temperature data } val = config_state_values[1]; if (val) { // set maximum heat limit - therm_ceil = 30 + val; + therm_ceil = 30 + val - 1; } if (therm_ceil > MAX_THERM_CEIL) therm_ceil = MAX_THERM_CEIL; } @@ -589,7 +590,7 @@ uint8_t nearest_level(int16_t target) { for(uint8_t i=0; i<ramp_discrete_steps; i++) { this_level = ramp_discrete_floor + (i * (uint16_t)ramp_range / (ramp_discrete_steps-1)); - int8_t diff = target - this_level; + int16_t diff = target - this_level; if (diff < 0) diff = -diff; if (diff <= (ramp_discrete_step_size>>1)) return this_level; @@ -684,9 +685,6 @@ void loop() { StatePtr state = current_state; - #ifdef USE_DYNAMIC_UNDERCLOCKING - auto_clock_speed(); - #endif if (0) {} #ifdef USE_BATTCHECK @@ -697,7 +695,7 @@ void loop() { #ifdef USE_THERMAL_REGULATION // TODO: blink out therm_ceil during thermal_config_state else if (state == tempcheck_state) { - blink_num(temperature>>1); + blink_num(temperature); nice_delay_ms(1000); } #endif |
