Browse Source

boolval revisited (#8016)

Luc Van Daele 7 years ago
parent
commit
3986a84f77

+ 1
- 1
Marlin/src/gcode/calibrate/G33.cpp View File

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

+ 1
- 1
Marlin/src/gcode/eeprom/M500-M503.cpp View File

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

+ 1
- 1
Marlin/src/gcode/parser.h View File

294
 
294
 
295
   // Provide simple value accessors with default option
295
   // Provide simple value accessors with default option
296
   FORCE_INLINE static float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
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
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
298
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
299
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
299
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
300
   FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort()       : dval; }
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 View File

36
  *
36
  *
37
  *   X   Probe X position (default current X)
37
  *   X   Probe X position (default current X)
38
  *   Y   Probe Y position (default current Y)
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
 void GcodeSuite::G30() {
41
 void GcodeSuite::G30() {
42
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
42
   const float xpos = parser.linearval('X', current_position[X_AXIS] + X_PROBE_OFFSET_FROM_EXTRUDER),
51
 
51
 
52
   setup_for_endstop_or_probe_move();
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
   if (!isnan(measured_z)) {
56
   if (!isnan(measured_z)) {
57
     SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));
57
     SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos));

Loading…
Cancel
Save