Skip to content

Commit

Permalink
pwm: restore fix for esp8266 (rgbwpm2)
Browse files Browse the repository at this point in the history
  • Loading branch information
markirb authored and root committed Nov 29, 2024
1 parent f12cfd5 commit 559eb37
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/shelly_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ Status OutputPin::SetStatePWM(float duty, const char *source) {
LOG(LL_INFO, ("Duty: %.3f", duty));
if (duty == 0) {
mgos_pwm_set(pin_, 0, 0);
} else {
#if CS_PLATFORM == CS_P_ESP8266
} else if (duty == 1) {
mgos_gpio_write(pin_, 1);
LOG(LL_INFO,
("Output %d: %s (%s)", id(), (duty == 0 ? "OFF" : "ON"), source));
}
#endif
else {
mgos_pwm_set(pin_, 400, duty);
LOG(LL_INFO, ("Output %d: %f (%s)", id(), duty, source));
}
Expand Down

0 comments on commit 559eb37

Please sign in to comment.