소스 검색

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
Guðni Már Gilbert 3 년 전
부모
커밋
d8723c0eac
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      Firmware/cmdqueue.cpp

+ 1 - 2
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));
                 }