G-code parser: move gcode_source stuff ...

... from gcode_process.c/.h to gcode_parse.c/.h.
This commit is contained in:
Markus Hitter 2015-07-10 21:29:05 +02:00
parent 017e17801c
commit 277de42b00
4 changed files with 23 additions and 22 deletions

View File

@ -19,6 +19,20 @@
#endif #endif
/** Bitfield for available sources of G-code.
A typical source is the SD card or canned G-code. Serial is currently never
turned off.
*/
enum gcode_source gcode_sources = GCODE_SOURCE_SERIAL;
/** Bitfield for the current source of G-code.
Only one bit should be set at a time. The bit is set at start reading a
line and cleared when a line is done.
*/
enum gcode_source gcode_active = 0;
/// current or previous gcode word /// current or previous gcode word
/// for working out what to do with data just received /// for working out what to do with data just received
uint8_t last_field = 0; uint8_t last_field = 0;

View File

@ -61,6 +61,15 @@ typedef struct {
uint8_t checksum_calculated; ///< checksum we calculated uint8_t checksum_calculated; ///< checksum we calculated
} GCODE_COMMAND; } GCODE_COMMAND;
enum gcode_source {
GCODE_SOURCE_SERIAL = 0b00000001,
GCODE_SOURCE_SD = 0b00000010,
};
extern enum gcode_source gcode_sources;
extern enum gcode_source gcode_active;
/// the command being processed /// the command being processed
extern GCODE_COMMAND next_target; extern GCODE_COMMAND next_target;

View File

@ -35,20 +35,6 @@ uint8_t tool;
/// the tool to be changed when we get an M6 /// the tool to be changed when we get an M6
uint8_t next_tool; uint8_t next_tool;
/** Bitfield for available sources of G-code.
A typical source is the SD card or canned G-code. Serial is currently never
turned off.
*/
enum gcode_source gcode_sources = GCODE_SOURCE_SERIAL;
/** Bitfield for the current source of G-code.
Only one bit should be set at a time. The bit is set at start reading a
line and cleared when a line is done.
*/
enum gcode_source gcode_active = 0;
/************************************************************************//** /************************************************************************//**
\brief Processes command stored in global \ref next_target. \brief Processes command stored in global \ref next_target.

View File

@ -3,14 +3,6 @@
#include "gcode_parse.h" #include "gcode_parse.h"
enum gcode_source {
GCODE_SOURCE_SERIAL = 0b00000001,
GCODE_SOURCE_SD = 0b00000010,
};
extern enum gcode_source gcode_sources;
extern enum gcode_source gcode_active;
// the current tool // the current tool
extern uint8_t tool; extern uint8_t tool;