Update servo pause function in PwmPin.cpp

This commit is contained in:
Yitao Jiang 2024-06-29 12:31:37 -04:00 committed by GitHub
parent 22c7d32186
commit 8c67b28f6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -264,6 +264,17 @@ void ServoPin::set(double degrees){
ledc_channel_config(channel); ledc_channel_config(channel);
} }
///////////////////
void ServoPin::pause(boolean pauseState){
if(!channel)
return;
channel->duty=pauseState?(1<<timer->duty_resolution):0;
ledc_channel_config(channel);
}
//////////////////////////// ////////////////////////////
ledc_channel_config_t *LedC::channelList[LEDC_CHANNEL_MAX][LEDC_SPEED_MODE_MAX]={}; ledc_channel_config_t *LedC::channelList[LEDC_CHANNEL_MAX][LEDC_SPEED_MODE_MAX]={};