![]() |
Repetier-Firmware
0.80
|
#include <avr/pgmspace.h>
Go to the source code of this file.
Data Structures | |
struct | GCode |
struct | ring_buffer |
class | RFHardwareSerial |
class | SerialOutput |
Defines | |
#define | SERIAL_BUFFER_SIZE 128 |
#define | SERIAL_BUFFER_MASK 127 |
#define | RFSERIAL RFSerial |
#define | WAIT_OUT_EMPTY while(tx_buffer.head != tx_buffer.tail) {} |
#define | OUT_P_I(p, i) out.print_int_P(PSTR(p),(int)(i)) |
#define | OUT_P_I_LN(p, i) out.println_int_P(PSTR(p),(int)(i)) |
#define | OUT_P_L(p, i) out.print_long_P(PSTR(p),(long)(i)) |
#define | OUT_P_L_LN(p, i) out.println_long_P(PSTR(p),(long)(i)) |
#define | OUT_P_F(p, i) out.print_float_P(PSTR(p),(float)(i)) |
#define | OUT_P_F_LN(p, i) out.println_float_P(PSTR(p),(float)(i)) |
#define | OUT_P_FX(p, i, x) out.print_float_P(PSTR(p),(float)(i),x) |
#define | OUT_P_FX_LN(p, i, x) out.println_float_P(PSTR(p),(float)(i),x) |
#define | OUT_P(p) out.print_P(PSTR(p)) |
#define | OUT_P_LN(p) out.println_P(PSTR(p)) |
#define | OUT_ERROR_P(p) out.print_error_P(PSTR(p),false) |
#define | OUT_ERROR_P_LN(p) out.print_error_P(PSTR(p),true) |
#define | OUT(v) out.print(v) |
#define | OUT_LN out.println() |
#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_NO_XYZ(a) ((a->params & 56)==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_IS_V2(a) ((a->params & 4096)!=0) |
#define | GCODE_HAS_STRING(a) ((a->params & 32768)!=0) |
#define | GCODE_HAS_I(a) ((a->params2 & 1)!=0) |
#define | GCODE_HAS_J(a) ((a->params2 & 2)!=0) |
#define | GCODE_HAS_R(a) ((a->params2 & 4)!=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 | |
GCode * | gcode_next_command () |
void | gcode_command_finished (GCode *code) |
Removes the last returned command from cache. | |
void | gcode_read_serial () |
Read from serial console or sdcard. | |
void | gcode_execute_PString (PGM_P cmd) |
Execute commands in progmem stored string. Multiple commands are seperated by . | |
void | gcode_print_command (GCode *code) |
Print command on serial console. | |
byte | gcode_comp_binary_size (char *ptr) |
Computes size of binary data from bitfield. | |
bool | gcode_parse_binary (GCode *code, byte *buffer) |
bool | gcode_parse_ascii (GCode *code, char *line) |
void | emergencyStop () |
Variables | |
RFHardwareSerial | RFSerial |
ring_buffer | tx_buffer |
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 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_I | ( | a | ) | ((a->params2 & 1)!=0) |
#define GCODE_HAS_J | ( | a | ) | ((a->params2 & 2)!=0) |
#define GCODE_HAS_M | ( | a | ) | ((a->params & 2)!=0) |
#define GCODE_HAS_N | ( | a | ) | ((a->params & 1)!=0) |
#define GCODE_HAS_NO_XYZ | ( | a | ) | ((a->params & 56)==0) |
#define GCODE_HAS_P | ( | a | ) | ((a->params & 2048)!=0) |
#define GCODE_HAS_R | ( | a | ) | ((a->params2 & 4)!=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) |
#define GCODE_IS_V2 | ( | a | ) | ((a->params & 4096)!=0) |
#define OUT | ( | v | ) | out.print(v) |
#define OUT_ERROR_P | ( | p | ) | out.print_error_P(PSTR(p),false) |
#define OUT_ERROR_P_LN | ( | p | ) | out.print_error_P(PSTR(p),true) |
#define OUT_LN out.println() |
#define OUT_P | ( | p | ) | out.print_P(PSTR(p)) |
#define OUT_P_F | ( | p, | |
i | |||
) | out.print_float_P(PSTR(p),(float)(i)) |
#define OUT_P_F_LN | ( | p, | |
i | |||
) | out.println_float_P(PSTR(p),(float)(i)) |
#define OUT_P_FX | ( | p, | |
i, | |||
x | |||
) | out.print_float_P(PSTR(p),(float)(i),x) |
#define OUT_P_FX_LN | ( | p, | |
i, | |||
x | |||
) | out.println_float_P(PSTR(p),(float)(i),x) |
#define OUT_P_I | ( | p, | |
i | |||
) | out.print_int_P(PSTR(p),(int)(i)) |
#define OUT_P_I_LN | ( | p, | |
i | |||
) | out.println_int_P(PSTR(p),(int)(i)) |
#define OUT_P_L | ( | p, | |
i | |||
) | out.print_long_P(PSTR(p),(long)(i)) |
#define OUT_P_L_LN | ( | p, | |
i | |||
) | out.println_long_P(PSTR(p),(long)(i)) |
#define OUT_P_LN | ( | p | ) | out.println_P(PSTR(p)) |
#define SERIAL_BUFFER_MASK 127 |
#define SERIAL_BUFFER_SIZE 128 |
#define WAIT_OUT_EMPTY while(tx_buffer.head != tx_buffer.tail) {} |
void emergencyStop | ( | ) |
void gcode_command_finished | ( | GCode * | code | ) |
Removes the last returned command from cache.
Frees the cache used by the last command fetched.
byte gcode_comp_binary_size | ( | char * | ptr | ) |
Computes size of binary data from bitfield.
In the repetier-protocol in binary mode, the first 2 bytes define the data. From this bitfield, this function computes the size of the command including the 2 bytes of the bitfield and the 2 bytes for the checksum.
Gcode Letter to Bit and Datatype:
void gcode_execute_PString | ( | PGM_P | cmd | ) |
Execute commands in progmem stored string. Multiple commands are seperated by
.
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 | ||
) |
bool gcode_parse_binary | ( | GCode * | code, |
byte * | buffer | ||
) |
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.
byte debug_level |
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.