Defines |
| #define | bit_clear(x, y) x&= ~(1<<y) |
| #define | bit_set(x, y) x|= (1<<y) |
| #define | MAX_CMD_SIZE 96 |
Functions |
| void | rf_store_char (unsigned char c, ring_buffer *buffer) |
| byte | gcode_comp_binary_size (char *ptr) |
| | Computes size of binary data from bitfield.
|
| void | __cxa_pure_virtual () |
| void | gcode_resend () |
| | request resend of the expected line.
|
| void | emergencyStop () |
| void | gcode_checkinsert (GCode *act) |
| void | gcode_silent_insert () |
| GCode * | gcode_next_command () |
| void | gcode_command_finished (GCode *code) |
| | Removes the last returned command from cache.
|
| void | gcode_execute_PString (PGM_P cmd) |
| | Execute commands in progmem stored string. Multiple commands are seperated by
.
|
| void | gcode_read_serial () |
| | Read from serial console or sdcard.
|
| bool | gcode_parse_binary (GCode *code, byte *buffer) |
| float | gcode_value (char *s) |
| long | gcode_value_long (char *s) |
| bool | gcode_parse_ascii (GCode *code, char *line) |
| void | gcode_print_command (GCode *code) |
| | Print command on serial console.
|
Variables |
| GCode | gcode_buffer [GCODE_BUFFER_SIZE] |
| | Buffer for received commands.
|
| byte | gcode_rindex = 0 |
| | Read position in gcode_buffer.
|
| byte | gcode_windex = 0 |
| | Write position in gcode_buffer.
|
| byte | gcode_transbuffer [MAX_CMD_SIZE] |
| | Current received command.
|
| byte | gcode_wpos = 0 |
| | Writing position in gcode_transbuffer.
|
| byte | gcode_binary |
| | Flags the command as binary input.
|
| byte | gcode_last_binary = 0 |
| | Was the last successful command in binary mode?
|
| byte | gcode_comment = false |
| | Flags true if we are reading the comment part of a command.
|
| byte | gcode_binary_size |
| | Expected size of the incoming binary command.
|
| bool | gcode_wait_all_parsed = false |
| | Don't read until all commands are parsed. Needed if gcode_buffer is misused as storage for strings.
|
| long | gcode_lastN = 0 |
| | Last line number received.
|
| long | gcode_actN |
| | Line number of current command.
|
| char | gcode_wait_resend = -1 |
| | Waiting for line to be resend. -1 = no wait.
|
| volatile byte | gcode_buflen = 0 |
| | Number of commands stored in gcode_buffer.
|
| unsigned long | gcode_lastdata = 0 |
| | Time, when we got the last data packet. Used to detect missing bytes.
|
| SerialOutput | out |
| | Instance used for serail write operations.
|
| ring_buffer | rx_buffer = { { 0 }, 0, 0} |
| ring_buffer | tx_buffer = { { 0 }, 0, 0} |
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:
- N : Bit 0 : 16-Bit Integer
- M : Bit 1 : 8-Bit unsigned byte
- G : Bit 2 : 8-Bit unsigned byte
- X : Bit 3 : 32-Bit Float
- Y : Bit 4 : 32-Bit Float
- Z : Bit 5 : 32-Bit Float
- E : Bit 6 : 32-Bit Float
- : Bit 7 : always set to distinguish binary from ASCII line.
- F : Bit 8 : 32-Bit Float
- T : Bit 9 : 8 Bit Integer
- S : Bit 10 : 32 Bit Value
- P : Bit 11 : 32 Bit Integer
- V2 : Bit 12 : Version 2 command for additional commands/sizes
- Ext : Bit 13 : There are 2 more bytes following with Bits, only for future versions
- Int :Bit 14 : Marks it as internal command,
- Text : Bit 15 : 16 Byte ASCII String terminated with 0 Second word if V2:
- I : Bit 0 : 32-Bit float
- J : Bit 1 : 32-Bit float
- R : Bit 2 : 32-Bit float