From d8723c0eac7c186199fff02ba9b4c4552d0b68e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 12 Sep 2021 16:47:03 +0000 Subject: [PATCH] Use code_value_uint8() in get_command() The if statement is simplified as the value is never negative and we can get rid of one variable Saves 12 bytes of flash memory --- Firmware/cmdqueue.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Firmware/cmdqueue.cpp b/Firmware/cmdqueue.cpp index fab0fe7dd..a48fcdb5c 100755 --- a/Firmware/cmdqueue.cpp +++ b/Firmware/cmdqueue.cpp @@ -486,8 +486,7 @@ void get_command() is_usb_printing = true; } if (Stopped == true) { - int gcode = strtol(strchr_pointer+1, NULL, 10); - if (gcode >= 0 && gcode <= 3) { + if (code_value_uint8() <= 3) { SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); LCD_MESSAGERPGM(_T(MSG_STOPPED)); }