Introduce gcode_init() and honor E_ABSOLUTE as the default.
This commit is contained in:
parent
ac22a57329
commit
eaf6c453be
|
|
@ -115,6 +115,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@
|
||||||
|
|
||||||
/** \def E_ABSOLUTE
|
/** \def E_ABSOLUTE
|
||||||
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
Some G-Code creators produce relative length commands for the extruder, others absolute ones. G-Code using absolute lengths can be recognized when there are G92 E0 commands from time to time. If you have G92 E0 in your G-Code, define this flag.
|
||||||
|
|
||||||
|
This is the startup default and can be changed with M82/M83 while running.
|
||||||
*/
|
*/
|
||||||
// #define E_ABSOLUTE
|
// #define E_ABSOLUTE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,18 @@ static int32_t decfloat_to_int(decfloat *df, uint32_t multiplicand) {
|
||||||
return df->sign ? -(int32_t)r : (int32_t)r;
|
return df->sign ? -(int32_t)r : (int32_t)r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gcode_init(void) {
|
||||||
|
// gcc guarantees us all variables are initialised to 0.
|
||||||
|
|
||||||
|
// assume a G1 by default
|
||||||
|
next_target.seen_G = 1;
|
||||||
|
next_target.G = 1;
|
||||||
|
|
||||||
|
#ifndef E_ABSOLUTE
|
||||||
|
next_target.option_e_relative = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// TODO TODO: write a gcode_init(), next_target is used uninitialised. For a hint on what to do, see line 340ff.
|
// TODO TODO: write a gcode_init(), next_target is used uninitialised. For a hint on what to do, see line 340ff.
|
||||||
|
|
||||||
/// Character Received - add it to our command
|
/// Character Received - add it to our command
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,8 @@ typedef struct {
|
||||||
/// the command being processed
|
/// the command being processed
|
||||||
extern GCODE_COMMAND next_target;
|
extern GCODE_COMMAND next_target;
|
||||||
|
|
||||||
|
void gcode_init(void);
|
||||||
|
|
||||||
/// accept the next character and process it
|
/// accept the next character and process it
|
||||||
void gcode_parse_char(uint8_t c);
|
void gcode_parse_char(uint8_t c);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue