add tui and persistent targets
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "config.h"
|
||||
#include "pid_autotuner.h"
|
||||
#include "pid_controller.h"
|
||||
#include "settings_store.h"
|
||||
#include "tuning_store.h"
|
||||
|
||||
class ThermalController {
|
||||
@@ -54,6 +55,12 @@ public:
|
||||
Serial.println(F("Loaded learned PID from EEPROM"));
|
||||
printTuning();
|
||||
}
|
||||
|
||||
SettingsData settings;
|
||||
if (settingsLoad(settings) && settings.targetC >= TARGET_MIN_C &&
|
||||
settings.targetC <= TARGET_MAX_C) {
|
||||
setTarget(settings.targetC, false);
|
||||
}
|
||||
}
|
||||
|
||||
void applyTuning(const TuningData &data) {
|
||||
@@ -122,7 +129,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void setTarget(float targetC) {
|
||||
void setTarget(float targetC, bool persist = true) {
|
||||
targetTempC_ = targetC;
|
||||
pid_.setSetpoint(targetC);
|
||||
pid_.reset();
|
||||
@@ -134,6 +141,9 @@ public:
|
||||
fanIdleOverride_ = false;
|
||||
}
|
||||
applyFan();
|
||||
if (persist && targetC >= TARGET_MIN_C && targetC <= TARGET_MAX_C) {
|
||||
settingsSaveTarget(targetC);
|
||||
}
|
||||
}
|
||||
|
||||
void noteSensorMax(float maxTempC) {
|
||||
|
||||
Reference in New Issue
Block a user