Use calibrated frequencty for the base timer. No big difference but more scientific, maybe

This commit is contained in:
Hakan Bastedt
2024-04-07 22:55:23 +02:00
parent 226cbc5035
commit 5eda2b451e

View File

@@ -212,9 +212,8 @@ void setup(void)
Step = new StepGen3;
baseTimer = new HardwareTimer(TIM11); // The base period timer
uint32_t usecs = BASE_PERIOD / sync0CycleTime;
// setFrequencyAdjustedMicrosSeconds(baseTimer, usecs);
baseTimer->setOverflow(BASE_PERIOD / 1000, MICROSEC_FORMAT);
setFrequencyAdjustedMicrosSeconds(baseTimer, BASE_PERIOD / 1000);
// baseTimer->setOverflow(BASE_PERIOD / 1000, MICROSEC_FORMAT);
baseTimer->attachInterrupt(basePeriodCB);
syncTimer = new HardwareTimer(TIM3); // The Linuxcnc servo period sync timer