![]() |
Repetier-Firmware
0.91
|
#include <gcode.h>
Public Member Functions | |
bool | hasM () |
bool | hasN () |
bool | hasG () |
bool | hasX () |
bool | hasY () |
bool | hasZ () |
bool | hasNoXYZ () |
bool | hasE () |
bool | hasF () |
bool | hasT () |
bool | hasS () |
bool | hasP () |
bool | isV2 () |
bool | hasString () |
bool | hasI () |
bool | hasJ () |
bool | hasR () |
long | getS (long def) |
long | getP (long def) |
void | setFormatError () |
bool | hasFormatError () |
void | printCommand () |
Print command on serial console. | |
bool | parseBinary (uint8_t *buffer, bool fromSerial) |
bool | parseAscii (char *line, bool fromSerial) |
void | popCurrentCommand () |
Removes the last returned command from cache. | |
void | echoCommand () |
Static Public Member Functions | |
static GCode * | peekCurrentCommand () |
static void | readFromSerial () |
Read from serial console or sdcard. | |
static void | pushCommand () |
static void | executeFString (FSTRINGPARAM(cmd)) |
Execute commands in progmem stored string. Multiple commands are seperated by . | |
static uint8_t | computeBinarySize (char *ptr) |
Computes size of binary data from bitfield. | |
Data Fields | |
unsigned int | N |
unsigned int | M |
unsigned int | G |
float | X |
float | Y |
float | Z |
float | E |
float | F |
uint8_t | T |
long | S |
long | P |
float | I |
float | J |
float | R |
char * | text |
Private Member Functions | |
void | debugCommandBuffer () |
void | checkAndPushCommand () |
float | parseFloatValue (char *s) |
long | parseLongValue (char *s) |
Static Private Member Functions | |
static void | requestResend () |
Private Attributes | |
unsigned int | params |
unsigned int | params2 |
Static Private Attributes | |
static GCode | commandsBuffered [GCODE_BUFFER_SIZE] |
Buffer for received commands. | |
static uint8_t | bufferReadIndex = 0 |
Read position in gcode_buffer. | |
static uint8_t | bufferWriteIndex = 0 |
Write position in gcode_buffer. | |
static uint8_t | commandReceiving [MAX_CMD_SIZE] |
Current received command. | |
static uint8_t | commandsReceivingWritePosition = 0 |
Writing position in gcode_transbuffer. | |
static uint8_t | sendAsBinary |
Flags the command as binary input. | |
static uint8_t | wasLastCommandReceivedAsBinary = 0 |
Was the last successful command in binary mode? | |
static uint8_t | commentDetected = false |
Flags true if we are reading the comment part of a command. | |
static uint8_t | binaryCommandSize |
Expected size of the incoming binary command. | |
static bool | waitUntilAllCommandsAreParsed = false |
Don't read until all commands are parsed. Needed if gcode_buffer is misused as storage for strings. | |
static uint32_t | lastLineNumber = 0 |
Last line number received. | |
static uint32_t | actLineNumber |
Line number of current command. | |
static int8_t | waitingForResend = -1 |
Waiting for line to be resend. -1 = no wait. | |
static volatile uint8_t | bufferLength = 0 |
Number of commands stored in gcode_buffer. | |
static millis_t | timeOfLastDataPacket = 0 |
Time, when we got the last data packet. Used to detect missing uint8_ts. | |
static uint8_t | formatErrors = 0 |
Number of sequential format errors. | |
Friends | |
class | SDCard |
class | UIDisplay |
void checkAndPushCommand | ( | ) | [private] |
Check if result is plausible. If it is, an ok is send and the command is stored in queue. If not, a resend and ok is send.
uint8_t computeBinarySize | ( | char * | ptr | ) | [static] |
Computes size of binary data from bitfield.
In the repetier-protocol in binary mode, the first 2 uint8_ts define the data. From this bitfield, this function computes the size of the command including the 2 uint8_ts of the bitfield and the 2 uint8_ts for the checksum.
Gcode Letter to Bit and Datatype:
void debugCommandBuffer | ( | ) | [private] |
void echoCommand | ( | ) |
void executeFString | ( | FSTRINGPARAM(cmd) | ) | [static] |
Execute commands in progmem stored string. Multiple commands are seperated by
.
long getP | ( | long | def | ) | [inline] |
long getS | ( | long | def | ) | [inline] |
bool hasE | ( | ) | [inline] |
bool hasF | ( | ) | [inline] |
bool hasFormatError | ( | ) | [inline] |
bool hasG | ( | ) | [inline] |
bool hasI | ( | ) | [inline] |
bool hasJ | ( | ) | [inline] |
bool hasM | ( | ) | [inline] |
bool hasN | ( | ) | [inline] |
bool hasNoXYZ | ( | ) | [inline] |
bool hasP | ( | ) | [inline] |
bool hasR | ( | ) | [inline] |
bool hasS | ( | ) | [inline] |
bool hasString | ( | ) | [inline] |
bool hasT | ( | ) | [inline] |
bool hasX | ( | ) | [inline] |
bool hasY | ( | ) | [inline] |
bool hasZ | ( | ) | [inline] |
bool isV2 | ( | ) | [inline] |
bool parseAscii | ( | char * | line, |
bool | fromSerial | ||
) |
bool parseBinary | ( | uint8_t * | buffer, |
bool | fromSerial | ||
) |
float parseFloatValue | ( | char * | s | ) | [inline, private] |
long parseLongValue | ( | char * | s | ) | [inline, private] |
GCode * peekCurrentCommand | ( | ) | [static] |
Get next command in command buffer. After the command is processed, call gcode_command_finished()
Get the next buffered command. Returns 0 if no more commands are buffered. For each returned command, the gcode_command_finished() function must be called.
void popCurrentCommand | ( | ) |
Removes the last returned command from cache.
void printCommand | ( | ) |
Print command on serial console.
void pushCommand | ( | ) | [static] |
void readFromSerial | ( | ) | [static] |
Read from serial console or sdcard.
Frees the cache used by the last command fetched.
This function is the main function to read the commands from serial console or from sdcard. It must be called frequently to empty the incoming buffer.
void requestResend | ( | ) | [static, private] |
void setFormatError | ( | ) | [inline] |
friend class SDCard [friend] |
friend class UIDisplay [friend] |
uint32_t actLineNumber [static, private] |
Line number of current command.
uint8_t binaryCommandSize [static, private] |
Expected size of the incoming binary command.
volatile uint8_t bufferLength = 0 [static, private] |
Number of commands stored in gcode_buffer.
uint8_t bufferReadIndex = 0 [static, private] |
Read position in gcode_buffer.
uint8_t bufferWriteIndex = 0 [static, private] |
Write position in gcode_buffer.
uint8_t commandReceiving [static, private] |
Current received command.
GCode commandsBuffered [static, private] |
Buffer for received commands.
uint8_t commandsReceivingWritePosition = 0 [static, private] |
Writing position in gcode_transbuffer.
uint8_t commentDetected = false [static, private] |
Flags true if we are reading the comment part of a command.
float E |
float F |
uint8_t formatErrors = 0 [static, private] |
Number of sequential format errors.
unsigned int G |
float I |
float J |
uint32_t lastLineNumber = 0 [static, private] |
Last line number received.
unsigned int M |
unsigned int N |
long P |
unsigned int params [private] |
unsigned int params2 [private] |
float R |
long S |
uint8_t sendAsBinary [static, private] |
Flags the command as binary input.
uint8_t T |
char* text |
millis_t timeOfLastDataPacket = 0 [static, private] |
Time, when we got the last data packet. Used to detect missing uint8_ts.
int8_t waitingForResend = -1 [static, private] |
Waiting for line to be resend. -1 = no wait.
bool waitUntilAllCommandsAreParsed = false [static, private] |
Don't read until all commands are parsed. Needed if gcode_buffer is misused as storage for strings.
uint8_t wasLastCommandReceivedAsBinary = 0 [static, private] |
Was the last successful command in binary mode?
float X |
float Y |
float Z |