Przeglądaj źródła

boolval revisited (#8016)

Luc Van Daele 7 lat temu
rodzic
commit
3986a84f77

+ 1
- 1
Marlin/src/gcode/calibrate/G33.cpp Wyświetl plik

@@ -161,7 +161,7 @@ void GcodeSuite::G33() {
161 161
     return;
162 162
   }
163 163
 
164
-  const bool towers_set           = parser.boolval('T', true),
164
+  const bool towers_set           = !parser.boolval('T'),
165 165
              stow_after_each      = parser.boolval('E'),
166 166
              _0p_calibration      = probe_points == 0,
167 167
              _1p_calibration      = probe_points == 1,

+ 1
- 1
Marlin/src/gcode/eeprom/M500-M503.cpp Wyświetl plik

@@ -51,7 +51,7 @@ void GcodeSuite::M502() {
51 51
    * M503: print settings currently in memory
52 52
    */
53 53
   void GcodeSuite::M503() {
54
-    (void)settings.report(!parser.boolval('S', true));
54
+    (void)settings.report(parser.boolval('S'));
55 55
   }
56 56
 
57 57
 #endif // !DISABLE_M503

+ 1
- 1
Marlin/src/gcode/parser.h Wyświetl plik

@@ -294,7 +294,7 @@ public:
294 294
 
295 295
   // Provide simple value accessors with default option
296 296
   FORCE_INLINE static float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
297
-  FORCE_INLINE static bool     boolval(const char c, const bool dval=false)   { return seen(c)    ? value_bool()         : dval; }
297
+  FORCE_INLINE static bool     boolval(const char c)                          { return seenval(c) ? value_bool()      : seen(c); }
298 298
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
299 299
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
300 300
   FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort()       : dval; }

+ 2
- 2
Marlin/src/gcode/probe/G30.cpp Wyświetl plik

@@ -36,7 +36,7 @@
36 36
  *
37 37
  *   X   Probe X position (default current X)
38 38
  *   Y   Probe Y position (default current Y)
39
- *   S0  Leave the probe deployed
39
+ *   E   Engage the probe for each probe
40 40
  */
41 41
 void GcodeSuite::G30() {
42 42
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
@@ -51,7 +51,7 @@ void GcodeSuite::G30() {
51 51
 
52 52
   setup_for_endstop_or_probe_move();
53 53
 
54
-  const float measured_z = probe_pt(xpos, ypos, parser.boolval('S', true), 1);
54
+  const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1);
55 55
 
56 56
   if (!isnan(measured_z)) {
57 57
     SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));

Ładowanie…
Anuluj
Zapisz