|
|
|
|
63
|
|
63
|
|
64
|
#define INVALID_SERVO 255 // flag indicating an invalid servo index
|
64
|
#define INVALID_SERVO 255 // flag indicating an invalid servo index
|
65
|
|
65
|
|
66
|
-//
|
|
|
67
|
-#define usToTicks(_us) (( clockCyclesPerMicrosecond()* _us) / PRESCALER) // converts microseconds to tick (PRESCALER depends on architecture)
|
|
|
68
|
-#define ticksToUs(_ticks) (( (unsigned)_ticks * PRESCALER)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
|
|
|
|
|
66
|
+// Convert microseconds to ticks and back (PRESCALER depends on architecture)
|
|
|
67
|
+#define usToTicks(_us) (clockCyclesPerMicrosecond() * (_us) / (PRESCALER))
|
|
|
68
|
+#define ticksToUs(_ticks) (unsigned(_ticks) * (PRESCALER) / clockCyclesPerMicrosecond())
|
69
|
|
69
|
|
70
|
//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER))
|
70
|
//#define NBR_TIMERS ((MAX_SERVOS) / (SERVOS_PER_TIMER))
|
71
|
|
71
|
|