You need to log in to create posts and topics.

[AVR/Attiny85] comp match skipped after OCR0A update

PreviousPage 3 of 3

just added an edit on my post before 😉

arcachofo has reacted to this post.
arcachofo

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() 

PreviousPage 3 of 3