Коррекция уровня оптики, вкл по умолчанию, выкл в сне
плюс коррекции по отображению
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user