From 8924389dfcf407f9e5a07ac2cc088781651f4726 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <github@thinkyhead.com>
Date: Sat, 25 May 2019 22:32:51 -0500
Subject: [PATCH] =?UTF-8?q?Tweak=20servo=20=C2=B5s=20macros?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/HAL/shared/servo_private.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Marlin/src/HAL/shared/servo_private.h b/Marlin/src/HAL/shared/servo_private.h
index d2d96ce000..158759c455 100644
--- a/Marlin/src/HAL/shared/servo_private.h
+++ b/Marlin/src/HAL/shared/servo_private.h
@@ -63,9 +63,9 @@
 
 #define INVALID_SERVO         255     // flag indicating an invalid servo index
 
-//
-#define usToTicks(_us)    (( clockCyclesPerMicrosecond()* _us) / PRESCALER)     // converts microseconds to tick (PRESCALER depends on architecture)
-#define ticksToUs(_ticks) (( (unsigned)_ticks * PRESCALER)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds
+// Convert microseconds to ticks and back (PRESCALER depends on architecture)
+#define usToTicks(_us)    (clockCyclesPerMicrosecond() * (_us) / (PRESCALER))
+#define ticksToUs(_ticks) (unsigned(_ticks) * (PRESCALER) / clockCyclesPerMicrosecond())
 
 //#define NBR_TIMERS        ((MAX_SERVOS) / (SERVOS_PER_TIMER))
 
-- 
GitLab