소스 검색

Standardize code_value_bool

Scott Lahteine 8 년 전
부모
커밋
661fe09ce7
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2
    2
      Marlin/Marlin_main.cpp

+ 2
- 2
Marlin/Marlin_main.cpp 파일 보기

@@ -1129,7 +1129,7 @@ inline uint16_t code_value_ushort() { return (uint16_t)strtoul(seen_pointer + 1,
1129 1129
 
1130 1130
 inline uint8_t code_value_byte() { return (uint8_t)(constrain(strtol(seen_pointer + 1, NULL, 10), 0, 255)); }
1131 1131
 
1132
-inline bool code_value_bool() { return code_value_byte() > 0; }
1132
+inline bool code_value_bool() { return !code_has_value() || code_value_byte() > 0; }
1133 1133
 
1134 1134
 #if ENABLED(INCH_MODE_SUPPORT)
1135 1135
   inline void set_input_linear_units(LinearUnit units) {
@@ -5950,7 +5950,7 @@ void quickstop_stepper() {
5950 5950
   /**
5951 5951
    * M420: Enable/Disable Mesh Bed Leveling
5952 5952
    */
5953
-  inline void gcode_M420() { if (code_seen('S') && code_has_value()) mbl.set_has_mesh(code_value_bool()); }
5953
+  inline void gcode_M420() { if (code_seen('S')) mbl.set_has_mesh(code_value_bool()); }
5954 5954
 
5955 5955
   /**
5956 5956
    * M421: Set a single Mesh Bed Leveling Z coordinate

Loading…
취소
저장