Repetier-Firmware 0.2
Repetier/gcode.h File Reference
#include <avr/pgmspace.h>

Go to the source code of this file.

Data Structures

struct  GCode
class  SerialOutput

Defines

#define GCODE_HAS_N(a)   ((a->params & 1)!=0)
#define GCODE_HAS_M(a)   ((a->params & 2)!=0)
#define GCODE_HAS_G(a)   ((a->params & 4)!=0)
#define GCODE_HAS_X(a)   ((a->params & 8)!=0)
#define GCODE_HAS_Y(a)   ((a->params & 16)!=0)
#define GCODE_HAS_Z(a)   ((a->params & 32)!=0)
#define GCODE_HAS_E(a)   ((a->params & 64)!=0)
#define GCODE_HAS_F(a)   ((a->params & 256)!=0)
#define GCODE_HAS_T(a)   ((a->params & 512)!=0)
#define GCODE_HAS_S(a)   ((a->params & 1024)!=0)
#define GCODE_HAS_P(a)   ((a->params & 2048)!=0)
#define GCODE_HAS_STRING(a)   ((a->params & 32768)!=0)
#define DEBUG_ECHO   ((debug_level & 1)!=0)
#define DEBUG_INFO   ((debug_level & 2)!=0)
#define DEBUG_ERRORS   ((debug_level & 4)!=0)
#define DEBUG_DRYRUN   ((debug_level & 8)!=0)
#define DEBUG_COMMUNICATION   ((debug_level & 16)!=0)
#define DEBUG_NO_MOVES   ((debug_level & 32)!=0)

Functions

GCodegcode_next_command ()
void gcode_command_finished ()
 Removes the last returned command from cache.
void gcode_read_serial ()
 Read from serial console or sdcard.
void gcode_print_command (GCode *code)
 Print command on serial console.
bool gcode_parse_binary (GCode *code, byte *buffer)
bool gcode_parse_ascii (GCode *code, char *line)

Variables

SerialOutput out
 Instance used for serail write operations.
byte debug_level
 Bitfield defining debug output. 1 = echo, 2 = info, 4 = error, 8 = dry run., 16 = Only communication, 32 = No moves.

Define Documentation

#define DEBUG_COMMUNICATION   ((debug_level & 16)!=0)
#define DEBUG_DRYRUN   ((debug_level & 8)!=0)
#define DEBUG_ECHO   ((debug_level & 1)!=0)
#define DEBUG_ERRORS   ((debug_level & 4)!=0)
#define DEBUG_INFO   ((debug_level & 2)!=0)
#define DEBUG_NO_MOVES   ((debug_level & 32)!=0)
#define GCODE_HAS_E (   a)    ((a->params & 64)!=0)
#define GCODE_HAS_F (   a)    ((a->params & 256)!=0)
#define GCODE_HAS_G (   a)    ((a->params & 4)!=0)
#define GCODE_HAS_M (   a)    ((a->params & 2)!=0)
#define GCODE_HAS_N (   a)    ((a->params & 1)!=0)
#define GCODE_HAS_P (   a)    ((a->params & 2048)!=0)
#define GCODE_HAS_S (   a)    ((a->params & 1024)!=0)
#define GCODE_HAS_STRING (   a)    ((a->params & 32768)!=0)
#define GCODE_HAS_T (   a)    ((a->params & 512)!=0)
#define GCODE_HAS_X (   a)    ((a->params & 8)!=0)
#define GCODE_HAS_Y (   a)    ((a->params & 16)!=0)
#define GCODE_HAS_Z (   a)    ((a->params & 32)!=0)

Function Documentation

void gcode_command_finished ( )

Removes the last returned command from cache.

Frees the cache used by the last command fetched.

GCode* gcode_next_command ( )

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.

bool gcode_parse_ascii ( GCode code,
char *  line 
)

Converts a ascii GCode line into a GCode structure.

bool gcode_parse_binary ( GCode code,
byte *  buffer 
)

Converts a binary bytefield containing one GCode line into a GCode structure. Returns true if checksum was correct.

void gcode_print_command ( GCode code)

Print command on serial console.

void gcode_read_serial ( )

Read from serial console or sdcard.

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.


Variable Documentation

Bitfield defining debug output. 1 = echo, 2 = info, 4 = error, 8 = dry run., 16 = Only communication, 32 = No moves.

Instance used for serail write operations.

 All Data Structures Files Functions Variables Typedefs Friends Defines