yarf 0.1
Yet Another RepRap Firmware
Defines | Functions
src/input/gcode.h File Reference

The g-code component parses incoming g-code commands and calls the corresponding functions in the commands component. More...

#include <stdio.h>

Go to the source code of this file.

Defines

#define GCODE_UNEXPECTED_LINE   -8
#define GCODE_SYNTAX_ERROR   -7
#define GCODE_COMMAND_UNKNOWN   -6
#define GCODE_PARSE_COMMAND_CHECKSUM_FAILED   -5
#define GCODE_PARSE_COMMAND_READ_FAILURE   -4
#define GCODE_PARSE_COMMAND_UNEXPECTED_CHARACTER   -3
#define GCODE_PARSE_COMMAND_SYNTAX_ERROR   -2
#define GCODE_PARSE_COMMAND_EMPTY   -1
#define GCODE_PARSE_COMMAND_SUCCESS   0
#define GCODE_PROCESS_COMMAND_SUCCESS   0

Functions

void gcode_init (FILE *host_stream)
 Initializes the g-code component.
int gcode_process_command (void)
 Reads and processes an incoming g-code command from the host stream.

Detailed Description

The g-code component parses incoming g-code commands and calls the corresponding functions in the commands component.

Author:
Pieter Agten (pieter.agten@gmail.com)
Date:
20 sep 2011

Definition in file gcode.h.


Function Documentation

void gcode_init ( FILE *  host_stream)

Initializes the g-code component.

Parameters:
host_streamthe stream from which to read the g-codes and on which to output responses

Definition at line 583 of file gcode.c.

int gcode_process_command ( void  )

Reads and processes an incoming g-code command from the host stream.

Returns:
GCODE_PROCESS_COMMAND_SUCCESS if the command was handled successfully, or one of the error codes if not.

Definition at line 590 of file gcode.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines