Period improperly calculated in Servo library for megaavr microcontrollers (Arduino Nano Every) #59
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
This was submitted to the wrong area, so is being resubmitted here. Excuse me for lack of familiarity with GitHub.
The
ServoHandler
function inlibraries/Servo/src/megaavr/Servo.cpp
improperly calculates the wait time for the refresh period to expire. This certainly came about from the differences between ATmega328P and ATmega4809 Timer/Counters. The number of ticks into the period must be accumulated to calculate the new CCMP value necessary. This should have been done with thetcCounterValue
variable, which I have done here. I'm providing my fix for consideration.The text was updated successfully, but these errors were encountered: