diff options
| -rw-r--r-- | spaghetti-monster/anduril/config-default.h | 6 | ||||
| -rw-r--r-- | spaghetti-monster/fsm-ramping.c | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/config-default.h b/spaghetti-monster/anduril/config-default.h index b66a645..bc301e0 100644 --- a/spaghetti-monster/anduril/config-default.h +++ b/spaghetti-monster/anduril/config-default.h @@ -20,7 +20,13 @@ // overheat protection #define USE_THERMAL_REGULATION +#if (ATTINY==85) || (ATTINY==1634) +// sloppy temperature sensor needs bigger error margin #define DEFAULT_THERM_CEIL 45 // try not to get hotter than this (in C) +#else +// more accurate temperature sensor can regulate higher safely +#define DEFAULT_THERM_CEIL 50 // try not to get hotter than this (in C) +#endif // Comment out to disable automatic calibration on factory reset // - If so, be sure to set THERM_CAL_OFFSET to the correct calibration offset // - Calibration can still be overridden in temperature check mode diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c index 89f540b..adc8acb 100644 --- a/spaghetti-monster/fsm-ramping.c +++ b/spaghetti-monster/fsm-ramping.c @@ -241,15 +241,14 @@ void gradual_tick() { uint8_t gt = gradual_target; if (gt < actual_level) gt = actual_level - 1; else if (gt > actual_level) gt = actual_level + 1; - gt --; // call the relevant hardware-specific function GradualTickFuncPtr gradual_tick_func = channels[channel_mode].gradual_tick; - bool done = gradual_tick_func(gt); + bool done = gradual_tick_func(gt - 1); if (done) { uint8_t orig = gradual_target; - set_level(gt + 1); + set_level(gt); gradual_target = orig; } } |
