diff --git a/sonoff/xdrv_light.ino b/sonoff/xdrv_light.ino index 478ef70be..2eff11895 100644 --- a/sonoff/xdrv_light.ino +++ b/sonoff/xdrv_light.ino @@ -339,6 +339,9 @@ void LightInit(void) if (light_type < LT_PWM6) { // PWM for (byte i = 0; i < light_type; i++) { Settings.pwm_value[i] = 0; // Disable direct PWM control + if (pin[GPIO_PWM1 +i] < 99) { + pinMode(pin[GPIO_PWM1 +i], OUTPUT); + } } if (LT_PWM1 == light_type) { Settings.light_color[0] = 255; // One PWM channel only supports Dimmer but needs max color diff --git a/sonoff/xsns_01_counter.ino b/sonoff/xsns_01_counter.ino index 0b263611f..007662aff 100644 --- a/sonoff/xsns_01_counter.ino +++ b/sonoff/xsns_01_counter.ino @@ -59,6 +59,8 @@ void CounterUpdate4() CounterUpdate(4); } +/********************************************************************************************/ + void CounterSaveState() { for (byte i = 0; i < MAX_COUNTERS; i++) { @@ -68,8 +70,6 @@ void CounterSaveState() } } -/********************************************************************************************/ - void CounterInit() { typedef void (*function) () ; @@ -143,6 +143,9 @@ boolean Xsns01(byte function) CounterShow(0); break; #endif // USE_WEBSERVER + case FUNC_XSNS_SAVE_STATE: + CounterSaveState(); + break; } return result; }