From 913a54a86accab2a6959c4fcaf53711502f2d954 Mon Sep 17 00:00:00 2001 From: pwpiwi Date: Thu, 26 Jul 2018 17:18:10 +0200 Subject: [PATCH] save 2.3K flash-memory by avoiding a single floating point operation (#630) --- armsrc/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/armsrc/util.c b/armsrc/util.c index e25c6e0b..59dfe07b 100644 --- a/armsrc/util.c +++ b/armsrc/util.c @@ -489,13 +489,13 @@ void WaitTicks(uint32_t ticks){ // 1us = 1.5ticks. void WaitUS(uint16_t us){ if ( us == 0 ) return; - WaitTicks( (uint32_t)(us * 1.5) ); + WaitTicks( (uint32_t)us * 3 / 2 ) ; } void WaitMS(uint16_t ms){ if (ms == 0) return; - WaitTicks( (uint32_t)(ms * 1500) ); + WaitTicks( (uint32_t)ms * 1500 ); } -- 2.39.5