From 6aff3c761bce52648acb079bbcebd88ed0807f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 11 Jun 2023 16:57:06 +0000 Subject: [PATCH] XYZCal: reduce code size in go_manhattan The variable always takes a value of subtraction between two int16_t values. It will also fit into int16_t Change in memory: Flash: -50 bytes: SRAM: 0 bytes --- Firmware/xyzcal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/xyzcal.cpp b/Firmware/xyzcal.cpp index 380065519..96130d2c9 100644 --- a/Firmware/xyzcal.cpp +++ b/Firmware/xyzcal.cpp @@ -535,7 +535,7 @@ void go_start_stop(uint8_t axes, uint8_t dir, int16_t acc, uint16_t min_delay_us /// moves X, Y, Z one after each other /// starts and ends at 0 speed void go_manhattan(int16_t x, int16_t y, int16_t z, int16_t acc, uint16_t min_delay_us){ - int32_t length; + int16_t length; // DBG(_n("x %d -> %d, "), x, _X); length = x - _X;