[AVR/Attiny85] comp match skipped after OCR0A update
Quote from arcachofo on September 6, 2024, 1:29 pmidea : in McuPrescaled add a rescheduleEvents(float ratio=1.0) method ; which do nothing (abstract ?) ; when prescaler change ; it call this method with the good ratio.
In McuTimer redef this method which only recalculate the next event (something like neweventtime = nowtime+(oldeveventtime-nowtime)*ratio) ; and maybe update some variables ; of course it also call an OcUnit equivalent method.
Yes, something like that.
There are already some methods for cases like this, for example PIC Vref module calls PIC Comparator if Vref is changed.
Have a look at McuModule::callBack() and McuModule::callBackDoub()Â
idea : in McuPrescaled add a rescheduleEvents(float ratio=1.0) method ; which do nothing (abstract ?) ; when prescaler change ; it call this method with the good ratio.
In McuTimer redef this method which only recalculate the next event (something like neweventtime = nowtime+(oldeveventtime-nowtime)*ratio) ; and maybe update some variables ; of course it also call an OcUnit equivalent method.
Yes, something like that.
There are already some methods for cases like this, for example PIC Vref module calls PIC Comparator if Vref is changed.
Have a look at McuModule::callBack() and McuModule::callBackDoub()Â