firmware - fix bug when saving system settings resetting LED and FAN PWM
This commit is contained in:
parent
f9914343e7
commit
61c7af5eb5
1 changed files with 5 additions and 2 deletions
|
@ -852,6 +852,9 @@ void POSTgrowSettings() {
|
|||
|
||||
|
||||
void POSTsystemSettings() {
|
||||
|
||||
unsigned short UseLEDrelais_old = UseLEDrelais;
|
||||
unsigned short UseFANrelais_old = UseFANrelais;
|
||||
NtpOffset = webserver.arg("NtpOffset").toInt();
|
||||
MoistureSensor_Type = webserver.arg("MoistureSensor_Type").toInt();
|
||||
SoilmoistureLow = webserver.arg("SoilmoistureLow").toInt();
|
||||
|
@ -909,14 +912,14 @@ void POSTsystemSettings() {
|
|||
|
||||
// when user uses an relais for LED control, we force here PinLEDPWM to 255
|
||||
// to ensure nothing bad happens and its turned on
|
||||
if(UseLEDrelais == false) {
|
||||
if( (UseLEDrelais == false) && (UseLEDrelais != UseLEDrelais_old) ) {
|
||||
PinLEDPWM = 255;
|
||||
EEPROM.put(213, PinLEDPWM);
|
||||
EEPROM.commit();
|
||||
Serial.println("UseLEDrelais is 0, forcing PinLEDPWM to max to prevent relais damage and ensure its turned on");
|
||||
}
|
||||
|
||||
if(UseFANrelais == false) {
|
||||
if( (UseFANrelais == false) && (UseFANrelais != UseFANrelais_old) ) {
|
||||
PinFANPWM = 255;
|
||||
EEPROM.put(215, PinFANPWM);
|
||||
EEPROM.commit();
|
||||
|
|
Loading…
Reference in a new issue