Prusa MINI Firmware overview
parser.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * parser.h - Parser for a GCode line, providing a parameter interface.
26  * Codes like M149 control the way the GCode parser behaves,
27  * so settings for these codes are located in this class.
28  */
29 
30 #include "../inc/MarlinConfig.h"
31 
32 //#define DEBUG_GCODE_PARSER
33 #if ENABLED(DEBUG_GCODE_PARSER)
34  #include "../libs/hex_print_routines.h"
35 #endif
36 
37 #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
38  typedef enum : uint8_t { TEMPUNIT_C, TEMPUNIT_K, TEMPUNIT_F } TempUnit;
39 #endif
40 
41 #if ENABLED(INCH_MODE_SUPPORT)
42  typedef enum : uint8_t { LINEARUNIT_MM, LINEARUNIT_INCH } LinearUnit;
43 #endif
44 
45 /**
46  * GCode parser
47  *
48  * - Parse a single gcode line for its letter, code, subcode, and parameters
49  * - FASTER_GCODE_PARSER:
50  * - Flags existing params (1 bit each)
51  * - Stores value offsets (1 byte each)
52  * - Provide accessors for parameters:
53  * - Parameter exists
54  * - Parameter has value
55  * - Parameter value in different units and types
56  */
57 class GCodeParser {
58 
59 private:
60  static char *value_ptr; // Set by seen, used to fetch the value
61 
62  #if ENABLED(FASTER_GCODE_PARSER)
63  static uint32_t codebits; // Parameters pre-scanned
64  static uint8_t param[26]; // For A-Z, offsets into command args
65  #else
66  static char *command_args; // Args start here, for slow scan
67  #endif
68 
69 public:
70 
71  // Global states for GCode-level units features
72 
73  static bool volumetric_enabled;
74 
75  #if ENABLED(INCH_MODE_SUPPORT)
76  static float linear_unit_factor, volumetric_unit_factor;
77  #endif
78 
79  #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
80  static TempUnit input_temp_units;
81  #endif
82 
83  // Command line state
84  static char *command_ptr, // The command, so it can be echoed
85  *string_arg, // string of command line
86  command_letter; // G, M, or T
87  static int codenum; // 123
88  #if USE_GCODE_SUBCODES
89  static uint8_t subcode; // .1
90  #endif
91 
92  #if ENABLED(GCODE_MOTION_MODES)
93  static int16_t motion_mode_codenum;
94  #if USE_GCODE_SUBCODES
95  static uint8_t motion_mode_subcode;
96  #endif
97  FORCE_INLINE static void cancel_motion_mode() { motion_mode_codenum = -1; }
98  #endif
99 
100  #if ENABLED(DEBUG_GCODE_PARSER)
101  static void debug();
102  #endif
103 
104  // Reset is done before parsing
105  static void reset();
106 
107  #define LETTER_BIT(N) ((N) - 'A')
108 
109  FORCE_INLINE static bool valid_signless(const char * const p) {
110  return NUMERIC(p[0]) || (p[0] == '.' && NUMERIC(p[1])); // .?[0-9]
111  }
112 
113  FORCE_INLINE static bool valid_float(const char * const p) {
114  return valid_signless(p) || ((p[0] == '-' || p[0] == '+') && valid_signless(&p[1])); // [-+]?.?[0-9]
115  }
116 
117  #if ENABLED(FASTER_GCODE_PARSER)
118 
119  FORCE_INLINE static bool valid_int(const char * const p) {
120  return NUMERIC(p[0]) || ((p[0] == '-' || p[0] == '+') && NUMERIC(p[1])); // [-+]?[0-9]
121  }
122 
123  // Set the flag and pointer for a parameter
124  static inline void set(const char c, char * const ptr) {
125  const uint8_t ind = LETTER_BIT(c);
126  if (ind >= COUNT(param)) return; // Only A-Z
127  SBI32(codebits, ind); // parameter exists
128  param[ind] = ptr ? ptr - command_ptr : 0; // parameter offset or 0
129  #if ENABLED(DEBUG_GCODE_PARSER)
130  if (codenum == 800) {
131  SERIAL_ECHOPAIR("Set bit ", (int)ind, " of codebits (", hex_address((void*)(codebits >> 16)));
132  print_hex_word((uint16_t)(codebits & 0xFFFF));
133  SERIAL_ECHOLNPAIR(") | param = ", (int)param[ind]);
134  }
135  #endif
136  }
137 
138  // Code seen bit was set. If not found, value_ptr is unchanged.
139  // This allows "if (seen('A')||seen('B'))" to use the last-found value.
140  static inline bool seen(const char c) {
141  const uint8_t ind = LETTER_BIT(c);
142  if (ind >= COUNT(param)) return false; // Only A-Z
143  const bool b = TEST32(codebits, ind);
144  if (b) {
145  char * const ptr = command_ptr + param[ind];
146  value_ptr = param[ind] && valid_float(ptr) ? ptr : nullptr;
147  }
148  return b;
149  }
150 
151  FORCE_INLINE static constexpr uint32_t letter_bits(const char * const str) {
152  return (str[0] ? _BV32(LETTER_BIT(str[0])) |
153  (str[1] ? _BV32(LETTER_BIT(str[1])) |
154  (str[2] ? _BV32(LETTER_BIT(str[2])) |
155  (str[3] ? _BV32(LETTER_BIT(str[3])) |
156  (str[4] ? _BV32(LETTER_BIT(str[4])) |
157  (str[5] ? _BV32(LETTER_BIT(str[5])) |
158  (str[6] ? _BV32(LETTER_BIT(str[6])) |
159  (str[7] ? _BV32(LETTER_BIT(str[7])) |
160  (str[8] ? _BV32(LETTER_BIT(str[8])) |
161  (str[9] ? _BV32(LETTER_BIT(str[9]))
162  : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0) : 0);
163  }
164 
165  // At least one of a list of code letters was seen
166  #ifdef CPU_32_BIT
167  FORCE_INLINE static bool seen(const char * const str) { return !!(codebits & letter_bits(str)); }
168  #else
169  // At least one of a list of code letters was seen
170  FORCE_INLINE static bool seen(const char * const str) {
171  const uint32_t letrbits = letter_bits(str);
172  const uint8_t * const cb = (uint8_t*)&codebits;
173  const uint8_t * const lb = (uint8_t*)&letrbits;
174  return (cb[0] & lb[0]) || (cb[1] & lb[1]) || (cb[2] & lb[2]) || (cb[3] & lb[3]);
175  }
176  #endif
177 
178  static inline bool seen_any() { return !!codebits; }
179 
180  #define SEEN_TEST(L) TEST32(codebits, LETTER_BIT(L))
181 
182  #else // !FASTER_GCODE_PARSER
183 
184  // Code is found in the string. If not found, value_ptr is unchanged.
185  // This allows "if (seen('A')||seen('B'))" to use the last-found value.
186  static inline bool seen(const char c) {
187  char *p = strchr(command_args, c);
188  const bool b = !!p;
189  if (b) value_ptr = valid_float(&p[1]) ? &p[1] : nullptr;
190  return b;
191  }
192 
193  static inline bool seen_any() { return *command_args == '\0'; }
194 
195  #define SEEN_TEST(L) !!strchr(command_args, L)
196 
197  // At least one of a list of code letters was seen
198  static inline bool seen(const char * const str) {
199  for (uint8_t i = 0; const char c = str[i]; i++)
200  if (SEEN_TEST(c)) return true;
201  return false;
202  }
203 
204  #endif // !FASTER_GCODE_PARSER
205 
206  // Seen any axis parameter
207  static inline bool seen_axis() {
208  return SEEN_TEST('X') || SEEN_TEST('Y') || SEEN_TEST('Z') || SEEN_TEST('E');
209  }
210 
211  // Populate all fields by parsing a single line of GCode
212  // This uses 54 bytes of SRAM to speed up seen/value
213  static void parse(char * p);
214 
215  #if ENABLED(CNC_COORDINATE_SYSTEMS)
216  // Parse the next parameter as a new command
217  static bool chain();
218  #endif
219 
220  // The code value pointer was set
221  FORCE_INLINE static bool has_value() { return value_ptr != nullptr; }
222 
223  // Seen a parameter with a value
224  static inline bool seenval(const char c) { return seen(c) && has_value(); }
225 
226  // Float removes 'E' to prevent scientific notation interpretation
227  static inline float value_float() {
228  if (value_ptr) {
229  char *e = value_ptr;
230  for (;;) {
231  const char c = *e;
232  if (c == '\0' || c == ' ') break;
233  if (c == 'E' || c == 'e') {
234  *e = '\0';
235  const float ret = strtof(value_ptr, nullptr);
236  *e = c;
237  return ret;
238  }
239  ++e;
240  }
241  return strtof(value_ptr, nullptr);
242  }
243  return 0;
244  }
245 
246  // Code value as a long or ulong
247  static inline int32_t value_long() { return value_ptr ? strtol(value_ptr, nullptr, 10) : 0L; }
248  static inline uint32_t value_ulong() { return value_ptr ? strtoul(value_ptr, nullptr, 10) : 0UL; }
249 
250  // Code value for use as time
251  static inline millis_t value_millis() { return value_ulong(); }
252  static inline millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); }
253 
254  // Reduce to fewer bits
255  static inline int16_t value_int() { return (int16_t)value_long(); }
256  static inline uint16_t value_ushort() { return (uint16_t)value_long(); }
257  static inline uint8_t value_byte() { return (uint8_t)constrain(value_long(), 0, 255); }
258 
259  // Bool is true with no value or non-zero
260  static inline bool value_bool() { return !has_value() || !!value_byte(); }
261 
262  // Units modes: Inches, Fahrenheit, Kelvin
263 
264  #if ENABLED(INCH_MODE_SUPPORT)
265  static inline float mm_to_linear_unit(const float mm) { return mm / linear_unit_factor; }
266  static inline float mm_to_volumetric_unit(const float mm) { return mm / (volumetric_enabled ? volumetric_unit_factor : linear_unit_factor); }
267 
268  // Init linear units by constructor
269  GCodeParser() { set_input_linear_units(LINEARUNIT_MM); }
270 
271  static inline void set_input_linear_units(const LinearUnit units) {
272  switch (units) {
273  default:
274  case LINEARUNIT_MM: linear_unit_factor = 1.0f; break;
275  case LINEARUNIT_INCH: linear_unit_factor = 25.4f; break;
276  }
277  volumetric_unit_factor = POW(linear_unit_factor, 3);
278  }
279 
280  static inline float axis_unit_factor(const AxisEnum axis) {
281  return (axis >= E_AXIS && volumetric_enabled ? volumetric_unit_factor : linear_unit_factor);
282  }
283 
284  static inline float linear_value_to_mm(const float v) { return v * linear_unit_factor; }
285  static inline float axis_value_to_mm(const AxisEnum axis, const float v) { return v * axis_unit_factor(axis); }
286  static inline float per_axis_value(const AxisEnum axis, const float v) { return v / axis_unit_factor(axis); }
287 
288  #else
289 
290  static inline float mm_to_linear_unit(const float mm) { return mm; }
291  static inline float mm_to_volumetric_unit(const float mm) { return mm; }
292 
293  static inline float linear_value_to_mm(const float v) { return v; }
294  static inline float axis_value_to_mm(const AxisEnum, const float v) { return v; }
295  static inline float per_axis_value(const AxisEnum, const float v) { return v; }
296 
297  #endif
298 
299  #define LINEAR_UNIT(V) parser.mm_to_linear_unit(V)
300  #define VOLUMETRIC_UNIT(V) parser.mm_to_volumetric_unit(V)
301 
302  static inline float value_linear_units() { return linear_value_to_mm(value_float()); }
303  static inline float value_axis_units(const AxisEnum axis) { return axis_value_to_mm(axis, value_float()); }
304  static inline float value_per_axis_units(const AxisEnum axis) { return per_axis_value(axis, value_float()); }
305 
306  #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
307 
308  static inline void set_input_temp_units(const TempUnit units) { input_temp_units = units; }
309 
310  #if HAS_LCD_MENU && DISABLED(DISABLE_M503)
311 
312  static inline char temp_units_code() {
313  return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
314  }
315  static inline PGM_P temp_units_name() {
316  return input_temp_units == TEMPUNIT_K ? PSTR("Kelvin") : input_temp_units == TEMPUNIT_F ? PSTR("Fahrenheit") : PSTR("Celsius");
317  }
318  static inline float to_temp_units(const float &f) {
319  switch (input_temp_units) {
320  case TEMPUNIT_F:
321  return f * 0.5555555556f + 32;
322  case TEMPUNIT_K:
323  return f + 273.15f;
324  case TEMPUNIT_C:
325  default:
326  return f;
327  }
328  }
329 
330  #endif // HAS_LCD_MENU && !DISABLE_M503
331 
332  static inline float value_celsius() {
333  const float f = value_float();
334  switch (input_temp_units) {
335  case TEMPUNIT_F:
336  return (f - 32) * 0.5555555556f;
337  case TEMPUNIT_K:
338  return f - 273.15f;
339  case TEMPUNIT_C:
340  default:
341  return f;
342  }
343  }
344 
345  static inline float value_celsius_diff() {
346  switch (input_temp_units) {
347  case TEMPUNIT_F:
348  return value_float() * 0.5555555556f;
349  case TEMPUNIT_C:
350  case TEMPUNIT_K:
351  default:
352  return value_float();
353  }
354  }
355 
356  #define TEMP_UNIT(N) parser.to_temp_units(N)
357 
358  #else // !TEMPERATURE_UNITS_SUPPORT
359 
360  static inline float value_celsius() { return value_float(); }
361  static inline float value_celsius_diff() { return value_float(); }
362 
363  #define TEMP_UNIT(N) (N)
364 
365  #endif // !TEMPERATURE_UNITS_SUPPORT
366 
368 
369  void unknown_command_error();
370 
371  // Provide simple value accessors with default option
372  static inline float floatval(const char c, const float dval=0.0) { return seenval(c) ? value_float() : dval; }
373  static inline bool boolval(const char c, const bool dval=false) { return seenval(c) ? value_bool() : (seen(c) ? true : dval); }
374  static inline uint8_t byteval(const char c, const uint8_t dval=0) { return seenval(c) ? value_byte() : dval; }
375  static inline int16_t intval(const char c, const int16_t dval=0) { return seenval(c) ? value_int() : dval; }
376  static inline uint16_t ushortval(const char c, const uint16_t dval=0) { return seenval(c) ? value_ushort() : dval; }
377  static inline int32_t longval(const char c, const int32_t dval=0) { return seenval(c) ? value_long() : dval; }
378  static inline uint32_t ulongval(const char c, const uint32_t dval=0) { return seenval(c) ? value_ulong() : dval; }
379  static inline float linearval(const char c, const float dval=0) { return seenval(c) ? value_linear_units() : dval; }
380  static inline float celsiusval(const char c, const float dval=0) { return seenval(c) ? value_celsius() : dval; }
381 
382 };
383 
384 extern GCodeParser parser;
WITHIN
#define WITHIN(N, L, H)
Definition: macros.h:195
GCodeParser::value_int
static int16_t value_int()
Definition: parser.h:255
XYZval::z
T z
Definition: types.h:286
GCodeParser::seen
static bool seen(const char *const str)
Definition: parser.h:198
GCodeParser::command_letter
static char command_letter
Definition: parser.h:84
SERIAL_CHAR
#define SERIAL_CHAR(x)
Definition: serial.h:69
NOLESS
#define NOLESS(v, n)
Definition: macros.h:127
XYval::a
T a
Definition: types.h:186
XYZEval
Definition: types.h:101
_BV32
#define _BV32(b)
Definition: macros.h:92
sq
#define sq(x)
Definition: wiring_constants.h:83
Planner::synchronize
static void synchronize()
Definition: planner.cpp:1556
ATAN2
#define ATAN2(y, x)
Definition: macros.h:279
parser
GCodeParser parser
Definition: createSpeedLookupTable.py:14
mbl
mesh_bed_leveling mbl
MSG_Z_MOVE_COMP
#define MSG_Z_MOVE_COMP
Definition: language.h:180
SERIAL_ECHO
#define SERIAL_ECHO(x)
Definition: serial.h:70
NUMERIC
#define NUMERIC(a)
Definition: macros.h:196
MSG_ERR_ARC_ARGS
#define MSG_ERR_ARC_ARGS
Definition: language.h:207
GCodeParser::linearval
static float linearval(const char c, const float dval=0)
Definition: parser.h:379
probe_offset
constexpr xyz_pos_t probe_offset
Definition: probe.h:58
GCodeParser::per_axis_value
static float per_axis_value(const AxisEnum, const float v)
Definition: parser.h:295
X_AXIS
Definition: types.h:37
GCodeParser::value_celsius_diff
static float value_celsius_diff()
Definition: parser.h:361
g29_auto.gcode
list gcode
Definition: g29_auto.py:44
GCodeParser::volumetric_enabled
static bool volumetric_enabled
Definition: parser.h:73
GCodeParser::parse
static void parse(char *p)
Definition: parser.cpp:97
GCodeParser::valid_signless
static FORCE_INLINE bool valid_signless(const char *const p)
Definition: parser.h:109
GCodeParser::floatval
static float floatval(const char c, const float dval=0.0)
Definition: parser.h:372
PARAM_TEST
#define PARAM_TEST
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
PGM_P
#define PGM_P
Definition: pgmspace.h:30
XYZEval::e
T e
Definition: types.h:383
SEEN_TEST
#define SEEN_TEST(L)
Definition: parser.h:195
babystep
Babystep babystep
GCodeParser::value_long
static int32_t value_long()
Definition: parser.h:247
i
uint8_t i
Definition: screen_test_graph.c:72
AxisEnum
AxisEnum
Definition: types.h:36
destination
xyze_pos_t destination
Definition: motion.cpp:110
millis
uint32_t millis(void)
Definition: wiring_time.c:29
GCodeParser::seenval
static bool seenval(const char c)
Definition: parser.h:224
GCodeParser::unknown_command_error
void unknown_command_error()
Definition: parser.cpp:327
GCodeParser::linear_value_to_mm
static float linear_value_to_mm(const float v)
Definition: parser.h:293
GCodeParser::byteval
static uint8_t byteval(const char c, const uint8_t dval=0)
Definition: parser.h:374
Temperature::manage_heater
static void manage_heater() _O2
Definition: temperature.cpp:975
SERIAL_ECHO_START
#define SERIAL_ECHO_START()
Definition: serial.h:179
feedRate_t
float feedRate_t
Definition: types.h:80
strtof
#define strtof
Definition: HAL.h:374
GCodeParser::value_per_axis_units
static float value_per_axis_units(const AxisEnum axis)
Definition: parser.h:304
IsRunning
bool IsRunning()
Definition: Marlin.h:331
LETTER_BIT
#define LETTER_BIT(N)
Definition: parser.h:107
GCodeParser::value_axis_units
static float value_axis_units(const AxisEnum axis)
Definition: parser.h:303
BS_TODO_AXIS
#define BS_TODO_AXIS(A)
Definition: babystep.h:29
POW
#define POW(x, y)
Definition: macros.h:280
GCodeParser::seen_axis
static bool seen_axis()
Definition: parser.h:207
ABS
#define ABS(a)
Definition: macros.h:266
GCodeParser::valid_float
static FORCE_INLINE bool valid_float(const char *const p)
Definition: parser.h:113
GCodeParser::ulongval
static uint32_t ulongval(const char c, const uint32_t dval=0)
Definition: parser.h:378
GCodeParser::codenum
static int codenum
Definition: parser.h:87
GCodeParser::boolval
static bool boolval(const char c, const bool dval=false)
Definition: parser.h:373
cubic_b_spline
void cubic_b_spline(const xyze_pos_t &position, const xyze_pos_t &target, const xy_pos_t(&offsets)[2], const feedRate_t &scaled_fr_mm_s, const uint8_t extruder)
XYval::b
T b
Definition: types.h:186
FORCE_INLINE
#define FORCE_INLINE
Definition: macros.h:40
RADIANS
#define RADIANS(d)
Definition: macros.h:98
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
GCodeParser::value_feedrate
static feedRate_t value_feedrate()
Definition: parser.h:367
current_position
xyze_pos_t current_position
Definition: motion.cpp:102
GCodeParser::has_value
static FORCE_INLINE bool has_value()
Definition: parser.h:221
XYval::magnitude
FI T magnitude() const
Definition: types.h:192
COUNT
#define COUNT(a)
Definition: macros.h:200
GcodeSuite::dwell
static void dwell(millis_t time)
Definition: gcode.cpp:149
FLOOR
#define FLOOR(x)
Definition: macros.h:284
sync_plan_position_e
void sync_plan_position_e()
Definition: motion.cpp:221
CEIL
#define CEIL(x)
Definition: macros.h:283
SBI32
#define SBI32(n, b)
Definition: macros.h:94
GCodeParser::subcode
static uint8_t subcode
Definition: parser.h:89
GCodeParser::value_float
static float value_float()
Definition: parser.h:227
constrain
#define constrain(amt, low, high)
Definition: wiring_constants.h:79
GCodeParser::reset
static void reset()
Definition: parser.cpp:82
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
GCodeParser::longval
static int32_t longval(const char c, const int32_t dval=0)
Definition: parser.h:377
Planner::buffer_line
static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0)
Definition: planner.cpp:2663
feedrate_mm_s
feedRate_t feedrate_mm_s
Definition: motion.cpp:138
GCodeParser::value_millis
static millis_t value_millis()
Definition: parser.h:251
GCodeParser::value_ulong
static uint32_t value_ulong()
Definition: parser.h:248
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
XYval
Definition: types.h:99
createSpeedLookupTable.a
list a
Definition: createSpeedLookupTable.py:29
L
#define L(CODE)
Definition: macros.h:76
MOTION_CONDITIONS
#define MOTION_CONDITIONS
Definition: motion.h:233
MSG_Z
#define MSG_Z
Definition: language.h:321
SQRT
#define SQRT(x)
Definition: macros.h:281
GCodeParser::intval
static int16_t intval(const char c, const int16_t dval=0)
Definition: parser.h:375
XYval::x
T x
Definition: types.h:185
ELAPSED
#define ELAPSED(NOW, SOON)
Definition: millis_t.h:29
GCodeParser::value_millis_from_seconds
static millis_t value_millis_from_seconds()
Definition: parser.h:252
uint8_t
const uint8_t[]
Definition: 404_html.c:3
MSG_UNKNOWN_COMMAND
#define MSG_UNKNOWN_COMMAND
Definition: language.h:182
mesh_bed_leveling::z_offset
static float z_offset
Definition: mesh_bed_leveling.h:43
axis_unhomed_error
bool axis_unhomed_error(uint8_t axis_bits)
Definition: motion.cpp:1054
ui
MarlinUI ui
GcodeSuite::get_destination_from_command
static void get_destination_from_command()
Definition: gcode.cpp:115
GCodeParser::string_arg
static char * string_arg
Definition: parser.h:84
HYPOT
#define HYPOT(x, y)
Definition: macros.h:287
_BV
#define _BV(bit)
Definition: wiring_constants.h:99
NUMERIC_SIGNED
#define NUMERIC_SIGNED(a)
Definition: macros.h:198
GCodeParser::value_celsius
static float value_celsius()
Definition: parser.h:360
GCodeParser::celsiusval
static float celsiusval(const char c, const float dval=0)
Definition: parser.h:380
GCodeParser::value_bool
static bool value_bool()
Definition: parser.h:260
IS_SCARA
#define IS_SCARA
Definition: Conditionals_LCD.h:544
SERIAL_ERROR_MSG
#define SERIAL_ERROR_MSG(S)
Definition: serial.h:184
TEST32
#define TEST32(n, b)
Definition: macros.h:93
DECIMAL_SIGNED
#define DECIMAL_SIGNED(a)
Definition: macros.h:199
Y_AXIS
Definition: types.h:38
hotend_offset
constexpr xyz_pos_t hotend_offset[1]
Definition: motion.h:136
prepare_move_to_destination
void prepare_move_to_destination()
Definition: motion.cpp:984
GCodeParser::seen
static bool seen(const char c)
Definition: parser.h:186
parser.h
GCodeParser::value_linear_units
static float value_linear_units()
Definition: parser.h:302
GCodeParser::ushortval
static uint16_t ushortval(const char c, const uint16_t dval=0)
Definition: parser.h:376
Z_AXIS
Definition: types.h:39
GCodeParser::command_ptr
static char * command_ptr
Definition: parser.h:84
apply_motion_limits
void apply_motion_limits(xyz_pos_t &target)
Definition: motion.cpp:589
MSG_PROBE_OFFSET
#define MSG_PROBE_OFFSET
Definition: language.h:200
GcodeSuite::reset_stepper_timeout
static FORCE_INLINE void reset_stepper_timeout()
Definition: gcode.h:330
GCodeParser::mm_to_linear_unit
static float mm_to_linear_unit(const float mm)
Definition: parser.h:290
print_hex_word
void print_hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:78
SERIAL_EOL
#define SERIAL_EOL()
Definition: serial.h:181
Babystep::add_mm
static void add_mm(const AxisEnum axis, const float &mm)
MMM_TO_MMS
#define MMM_TO_MMS(MM_M)
Definition: types.h:83
XYval::y
T y
Definition: types.h:185
GCodeParser
Definition: parser.h:57
GCodeParser::axis_value_to_mm
static float axis_value_to_mm(const AxisEnum, const float v)
Definition: parser.h:294
hex_address
char * hex_address(const void *const w)
Definition: hex_print_routines.cpp:67
E_AXIS
Definition: types.h:40
relative_mode
bool relative_mode
Definition: motion.cpp:94
code
Definition: inftrees.h:24
GCodeParser::value_ushort
static uint16_t value_ushort()
Definition: parser.h:256
axis_codes
const xyze_char_t axis_codes
Definition: types.h:486
SERIAL_ECHOLNPGM
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
Planner::apply_leveling
static void apply_leveling(xyz_pos_t &raw)
Definition: planner.cpp:1381
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30
MMS_SCALED
#define MMS_SCALED(V)
Definition: types.h:85
idle
void idle()
Definition: Marlin.cpp:629
GCodeParser::value_byte
static uint8_t value_byte()
Definition: parser.h:257
thermalManager
Temperature thermalManager
Definition: temperature.cpp:89
UNUSED
#define UNUSED(X)
Definition: stm32f4xx_hal_def.h:74
GCodeParser::seen_any
static bool seen_any()
Definition: parser.h:193
GCodeParser::mm_to_volumetric_unit
static float mm_to_volumetric_unit(const float mm)
Definition: parser.h:291
millis_t
uint32_t millis_t
Definition: millis_t.h:26
parser
GCodeParser parser
Definition: parser.cpp:74
active_extruder
constexpr uint8_t active_extruder
Definition: motion.h:107
ENABLED
#define ENABLED(V...)
Definition: macros.h:177
planner
Planner planner
Definition: planner.cpp:111
MSG_ERR_BAD_PLANE_MODE
#define MSG_ERR_BAD_PLANE_MODE
Definition: language.h:205
createSpeedLookupTable.parser
parser
Definition: createSpeedLookupTable.py:14