File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 33#include < Arduino.h>
44#include < Servo.h>
55
6- #define usToTicks (_us ) ((clockCyclesPerMicrosecond() * _us) / 16 ) // converts microseconds to tick
7- #define ticksToUs (_ticks ) (((unsigned ) _ticks * 16 ) / clockCyclesPerMicrosecond()) // converts from ticks back to microseconds
6+ #define usToTicks (_us ) ((clockCyclesPerMicrosecond() / 16 * _us) / 4 ) // converts microseconds to tick
7+ #define ticksToUs (_ticks ) (((unsigned ) _ticks * 16 ) / ( clockCyclesPerMicrosecond() / 4 )) // converts from ticks back to microseconds
88
99#define TRIM_DURATION 5 // compensation ticks to trim adjust for digitalWrite delays
1010
@@ -79,7 +79,7 @@ ISR(TCB2_INT_vect)
7979
8080static void initISR (timer16_Sequence_t timer)
8181{
82- TCA0.SINGLE .CTRLA = (TCA_SINGLE_CLKSEL_DIV16_gc) | (TCA_SINGLE_ENABLE_bm);
82+ // TCA0.SINGLE.CTRLA = (TCA_SINGLE_CLKSEL_DIV16_gc) | (TCA_SINGLE_ENABLE_bm);
8383
8484 _timer->CTRLA = TCB_CLKSEL_CLKTCA_gc;
8585 // Timer to Periodic interrupt mode
You can’t perform that action at this time.
0 commit comments