Коррекция уровня оптики, вкл по умолчанию, выкл в сне

плюс коррекции по отображению
This commit is contained in:
2026-08-12 08:25:56 +03:00
parent f56595f767
commit 862781fa6a
10 changed files with 124 additions and 26 deletions

View File

@@ -187,3 +187,18 @@ void PwmGenerator::stop() {
#endif
running_ = false;
}
void PwmGenerator::active() {
// First detach/stop the PWM peripheral, then select the independently
// configured active level. The active and safe levels may be equal.
stop();
#if CONFIG_IDF_TARGET_ESP32C3
digitalWrite(GPIO_PWM, PWM_ACTIVE_LEVEL);
#elif CONFIG_IDF_TARGET_ESP32S3
if (mcpwmGenerator) mcpwm_generator_set_force_level(mcpwmGenerator, PWM_ACTIVE_LEVEL, true);
else {
pinMode(GPIO_PWM, OUTPUT);
digitalWrite(GPIO_PWM, PWM_ACTIVE_LEVEL);
}
#endif
}