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 3
3
#include < Arduino.h>
4
4
#include < Servo.h>
5
5
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
8
8
9
9
#define TRIM_DURATION 5 // compensation ticks to trim adjust for digitalWrite delays
10
10
@@ -79,7 +79,7 @@ ISR(TCB2_INT_vect)
79
79
80
80
static void initISR (timer16_Sequence_t timer)
81
81
{
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);
83
83
84
84
_timer->CTRLA = TCB_CLKSEL_CLKTCA_gc;
85
85
// Timer to Periodic interrupt mode
You can’t perform that action at this time.
0 commit comments