From b6572066f4ce7c544241df2c2bcf70bdb0b4e3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Fri, 19 May 2023 00:25:05 +0000 Subject: [PATCH] optimisation: compare uint16_t against uint16_t We're assigning step_rate with the 16-bit value of final_rate I would expect the comparison to be 16-bit also then. Change in memory: Flash: -32 bytes SRAM: 0 bytes --- Firmware/stepper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/stepper.cpp b/Firmware/stepper.cpp index e85b5fad7..7e511c7a3 100644 --- a/Firmware/stepper.cpp +++ b/Firmware/stepper.cpp @@ -863,7 +863,7 @@ FORCE_INLINE void isr() { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. // lower limit - if (step_rate < current_block->final_rate) + if (step_rate < uint16_t(current_block->final_rate)) step_rate = uint16_t(current_block->final_rate); }