Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 779e30b

Browse files
authored
Merge pull request #1 from raphweb/master
Fixed count >= min comparison for servo enable.
2 parents 81d90ba + 25d7c5e commit 779e30b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ESP32_ISR_Servo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ bool ESP32_ISR_Servo::enable(unsigned servoIndex)
322322
return false;
323323
}
324324

325-
if ( servo[servoIndex].count >= servo[servoIndex].min )
325+
if ( servo[servoIndex].count >= servo[servoIndex].min / TIMER_INTERVAL_MICRO )
326326
servo[servoIndex].enabled = true;
327327

328328
// ESP32 is a multi core / multi processing chip.
@@ -355,7 +355,7 @@ void ESP32_ISR_Servo::enableAll()
355355

356356
for (int servoIndex = 0; servoIndex < MAX_SERVOS; servoIndex++)
357357
{
358-
if ( (servo[servoIndex].count >= servo[servoIndex].min ) && !servo[servoIndex].enabled && (servo[servoIndex].pin <= ESP32_MAX_PIN) )
358+
if ( (servo[servoIndex].count >= servo[servoIndex].min / TIMER_INTERVAL_MICRO ) && !servo[servoIndex].enabled && (servo[servoIndex].pin <= ESP32_MAX_PIN) )
359359
{
360360
servo[servoIndex].enabled = true;
361361
}

0 commit comments

Comments
 (0)