Browse Source

Default G30 to engage / disengage

Scott Lahteine 6 years ago
parent
commit
230ae6a143
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      Marlin/src/gcode/parser.h
  2. 2
    2
      Marlin/src/gcode/probe/G30.cpp

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

309
 
309
 
310
   // Provide simple value accessors with default option
310
   // Provide simple value accessors with default option
311
   FORCE_INLINE static float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
311
   FORCE_INLINE static float    floatval(const char c, const float dval=0.0)   { return seenval(c) ? value_float()        : dval; }
312
-  FORCE_INLINE static bool     boolval(const char c)                          { return seenval(c) ? value_bool()         : seen(c); }
312
+  FORCE_INLINE static bool     boolval(const char c, const bool dval=false)   { return seenval(c) ? value_bool()         : (seen(c) ? true : dval); }
313
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
313
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
314
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
314
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
315
   FORCE_INLINE static uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort()       : dval; }
315
   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
- *   E   Engage the probe for each probe
39
+ *   E   Engage the probe for each probe (default 1)
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 ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_NONE;
54
+  const ProbePtRaise raise_after = parser.boolval('E', true) ? PROBE_PT_STOW : PROBE_PT_NONE;
55
   const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
55
   const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
56
 
56
 
57
   if (!isnan(measured_z)) {
57
   if (!isnan(measured_z)) {

Loading…
Cancel
Save