Parcourir la source

Default G30 to engage / disengage

Scott Lahteine il y a 6 ans
Parent
révision
230ae6a143
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 1
    1
      Marlin/src/gcode/parser.h
  2. 2
    2
      Marlin/src/gcode/probe/G30.cpp

+ 1
- 1
Marlin/src/gcode/parser.h Voir le fichier

@@ -309,7 +309,7 @@ public:
309 309
 
310 310
   // Provide simple value accessors with default option
311 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 313
   FORCE_INLINE static uint8_t  byteval(const char c, const uint8_t dval=0)    { return seenval(c) ? value_byte()         : dval; }
314 314
   FORCE_INLINE static int16_t  intval(const char c, const int16_t dval=0)     { return seenval(c) ? value_int()          : dval; }
315 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 Voir le fichier

@@ -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
- *   E   Engage the probe for each probe
39
+ *   E   Engage the probe for each probe (default 1)
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 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 55
   const float measured_z = probe_pt(xpos, ypos, raise_after, 1);
56 56
 
57 57
   if (!isnan(measured_z)) {

Chargement…
Annuler
Enregistrer