Browse Source

Tweak servo µs macros

Scott Lahteine 6 years ago
parent
commit
8924389dfc
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      Marlin/src/HAL/shared/servo_private.h

+ 3
- 3
Marlin/src/HAL/shared/servo_private.h View File

@@ -63,9 +63,9 @@
63 63
 
64 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 70
 //#define NBR_TIMERS        ((MAX_SERVOS) / (SERVOS_PER_TIMER))
71 71
 

Loading…
Cancel
Save