mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-25 16:47:29 +08:00
📝 GCode => G-Code
This commit is contained in:
parent
5bd39ba73f
commit
4744997c16
@ -75,7 +75,7 @@ static __always_inline void my_usart_irq(ring_buffer *rb, ring_buffer *wb, usart
|
||||
}
|
||||
|
||||
// Not every MarlinSerial port should handle emergency parsing.
|
||||
// It would not make sense to parse GCode from TMC responses, for example.
|
||||
// It would not make sense to parse G-Code from TMC responses, for example.
|
||||
constexpr bool serial_handles_emergency(int port) {
|
||||
return (false
|
||||
#ifdef SERIAL_PORT
|
||||
|
@ -536,7 +536,7 @@ void GcodeSuite::G28() {
|
||||
/**
|
||||
* Preserve DXC mode across a G28 for IDEX printers in DXC_DUPLICATION_MODE.
|
||||
* This is important because it lets a user use the LCD Panel to set an IDEX Duplication mode, and
|
||||
* then print a standard GCode file that contains a single print that does a G28 and has no other
|
||||
* then print a standard G-Code file that contains a single print that does a G28 and has no other
|
||||
* IDEX specific commands in it.
|
||||
*/
|
||||
#if ENABLED(DUAL_X_CARRIAGE)
|
||||
|
@ -44,7 +44,7 @@ void protected_pin_err() {
|
||||
}
|
||||
|
||||
/**
|
||||
* M42: Change pin status via GCode
|
||||
* M42: Change pin status via G-Code
|
||||
*
|
||||
* P<pin> Pin number (LED if omitted)
|
||||
* For LPC1768 specify pin P1_02 as M42 P102,
|
||||
|
@ -76,7 +76,7 @@ void GcodeSuite::M164() {
|
||||
* I[factor] Mix factor for extruder stepper 6
|
||||
*/
|
||||
void GcodeSuite::M165() {
|
||||
// Get mixing parameters from the GCode
|
||||
// Get mixing parameters from the G-Code
|
||||
// The total "must" be 1.0 (but it will be normalized)
|
||||
// If no mix factors are given, the old mix is preserved
|
||||
const char mixing_codes[] = { LIST_N(MIXING_STEPPERS, 'A', 'B', 'C', 'D', 'H', 'I') };
|
||||
|
@ -153,7 +153,7 @@ int8_t GcodeSuite::get_target_e_stepper_from_command(const int8_t dval/*=-1*/) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set XYZ...E destination and feedrate from the current GCode command
|
||||
* Set XYZ...E destination and feedrate from the current G-Code command
|
||||
*
|
||||
* - Set destination from included axis codes
|
||||
* - Set to current for missing axis codes
|
||||
@ -459,7 +459,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
#endif
|
||||
|
||||
#if ENABLED(DEBUG_GCODE_PARSER)
|
||||
case 800: parser.debug(); break; // G800: GCode Parser Test for G
|
||||
case 800: parser.debug(); break; // G800: G-Code Parser Test for G
|
||||
#endif
|
||||
|
||||
default: parser.unknown_command_warning(); break;
|
||||
@ -1035,7 +1035,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
||||
#endif
|
||||
|
||||
#if ENABLED(DEBUG_GCODE_PARSER)
|
||||
case 800: parser.debug(); break; // M800: GCode Parser Test for M
|
||||
case 800: parser.debug(); break; // M800: G-Code Parser Test for M
|
||||
#endif
|
||||
|
||||
#if ENABLED(GCODE_REPEAT_MARKERS)
|
||||
|
@ -462,7 +462,7 @@ public:
|
||||
*/
|
||||
enum MarlinBusyState : char {
|
||||
NOT_BUSY, // Not in a handler
|
||||
IN_HANDLER, // Processing a GCode
|
||||
IN_HANDLER, // Processing a G-Code
|
||||
IN_PROCESS, // Known to be blocking command input (as in G29)
|
||||
PAUSED_FOR_USER, // Blocking pending any input
|
||||
PAUSED_FOR_INPUT // Blocking pending text input (concept)
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* parser.cpp - Parser for a GCode line, providing a parameter interface.
|
||||
* parser.cpp - Parser for a G-Code line, providing a parameter interface.
|
||||
*/
|
||||
|
||||
#include "parser.h"
|
||||
@ -66,7 +66,7 @@ uint16_t GCodeParser::codenum;
|
||||
char *GCodeParser::command_args; // start of parameters
|
||||
#endif
|
||||
|
||||
// Create a global instance of the GCode parser singleton
|
||||
// Create a global instance of the G-Code parser singleton
|
||||
GCodeParser parser;
|
||||
|
||||
/**
|
||||
@ -108,7 +108,7 @@ void GCodeParser::reset() {
|
||||
|
||||
/**
|
||||
* Populate the command line state (command_letter, codenum, subcode, and string_arg)
|
||||
* by parsing a single line of GCode. 58 bytes of SRAM are used to speed up seen/value.
|
||||
* by parsing a single line of G-Code. 58 bytes of SRAM are used to speed up seen/value.
|
||||
*/
|
||||
void GCodeParser::parse(char *p) {
|
||||
|
||||
@ -317,7 +317,7 @@ void GCodeParser::parse(char *p) {
|
||||
#endif
|
||||
|
||||
#if ENABLED(FASTER_GCODE_PARSER)
|
||||
// Arguments MUST be uppercase for fast GCode parsing
|
||||
// Arguments MUST be uppercase for fast G-Code parsing
|
||||
#define PARAM_OK(P) WITHIN((P), 'A', 'Z')
|
||||
#else
|
||||
#define PARAM_OK(P) true
|
||||
|
@ -22,8 +22,8 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* parser.h - Parser for a GCode line, providing a parameter interface.
|
||||
* Codes like M149 control the way the GCode parser behaves,
|
||||
* parser.h - Parser for a G-Code line, providing a parameter interface.
|
||||
* Codes like M149 control the way the G-Code parser behaves,
|
||||
* so settings for these codes are located in this class.
|
||||
*/
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GCode parser
|
||||
* G-Code parser
|
||||
*
|
||||
* - Parse a single G-code line for its letter, code, subcode, and parameters
|
||||
* - FASTER_GCODE_PARSER:
|
||||
@ -68,7 +68,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
// Global states for GCode-level units features
|
||||
// Global states for G-Code-level units features
|
||||
|
||||
static bool volumetric_enabled;
|
||||
|
||||
@ -233,7 +233,7 @@ public:
|
||||
FORCE_INLINE static char* unescape_string(char* &src) { return src; }
|
||||
#endif
|
||||
|
||||
// Populate all fields by parsing a single line of GCode
|
||||
// Populate all fields by parsing a single line of G-Code
|
||||
// This uses 54 bytes of SRAM to speed up seen/value
|
||||
static void parse(char * p);
|
||||
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
*/
|
||||
struct SerialState {
|
||||
/**
|
||||
* GCode line number handling. Hosts may include line numbers when sending
|
||||
* G-Code line number handling. Hosts may include line numbers when sending
|
||||
* commands to Marlin, and lines will be checked for sequentiality.
|
||||
* M110 N<int> sets the current line number.
|
||||
*/
|
||||
@ -48,7 +48,7 @@ public:
|
||||
static SerialState serial_state[NUM_SERIAL]; //!< Serial states for each serial port
|
||||
|
||||
/**
|
||||
* GCode Command Queue
|
||||
* G-Code Command Queue
|
||||
* A simple (circular) ring buffer of BUFSIZE command strings.
|
||||
*
|
||||
* Commands are copied into this buffer by the command injectors
|
||||
|
@ -4201,7 +4201,7 @@ void JyersDWIN::popupHandler(const PopupID popupid, const bool option/*=false*/)
|
||||
case Popup_PIDWait: drawPopup(F("PID Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break;
|
||||
case Popup_MPCWait: drawPopup(F("MPC Autotune"), F("in process"), F("Please wait until done."), Proc_Wait, ICON_BLTouch); break;
|
||||
case Popup_Resuming: drawPopup(F("Resuming Print"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break;
|
||||
case Popup_Custom: drawPopup(F("Running Custom GCode"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break;
|
||||
case Popup_Custom: drawPopup(F("Running Custom G-Code"), F("Please wait until done."), F(""), Proc_Wait, ICON_BLTouch); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ Here's a basic flowchart of Marlin command processing:
|
||||
| Host | | SerialState RingBuffer | | |
|
||||
| | Marlin | NUM_SERIAL BUF_SIZE | | Marlin |
|
||||
+--+---+ R/TX_BUFFER_SIZE | +---+ +------------------+ | | |
|
||||
| +------------+ | | | | | | | GCode |
|
||||
| +------------+ | | | | | | | G-Code |
|
||||
| | | | | | | MAX_CMD_SIZE +-+-----> processor |
|
||||
| | Platform | | | | On EOL | +--------------+ | r_pos | |
|
||||
+-------------> serial's +-----------> +--------> | G-code | | | +-----------+
|
||||
|
Loading…
Reference in New Issue
Block a user