remove redundant code, fix queue logic in G28:home
This commit is contained in:
parent
1a2753ebfb
commit
54cb815b12
22
gcode.c
22
gcode.c
|
|
@ -26,15 +26,6 @@ GCODE_COMMAND next_target __attribute__ ((__section__ (".bss")));
|
||||||
utility functions
|
utility functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int8_t indexof(uint8_t c, const char *string) {
|
|
||||||
int8_t i;
|
|
||||||
for (i = 0; string[i]; i++) {
|
|
||||||
if (c == string[i])
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t decfloat_to_int(decfloat *df, int32_t multiplicand, int32_t denominator) {
|
int32_t decfloat_to_int(decfloat *df, int32_t multiplicand, int32_t denominator) {
|
||||||
int32_t r = df->mantissa;
|
int32_t r = df->mantissa;
|
||||||
uint8_t e = df->exponent;
|
uint8_t e = df->exponent;
|
||||||
|
|
@ -467,7 +458,8 @@ void process_gcode_command(GCODE_COMMAND *gcmd) {
|
||||||
SpecialMoveXY(-20 * STEPS_PER_MM_X, -20 * STEPS_PER_MM_Y, SEARCH_FEEDRATE_X);
|
SpecialMoveXY(-20 * STEPS_PER_MM_X, -20 * STEPS_PER_MM_Y, SEARCH_FEEDRATE_X);
|
||||||
|
|
||||||
// wait for queue to complete
|
// wait for queue to complete
|
||||||
for (;!queue_empty(););
|
for (;queue_empty() == 0;)
|
||||||
|
wd_reset();
|
||||||
|
|
||||||
// this is our home point
|
// this is our home point
|
||||||
startpoint.X = startpoint.Y = current_position.X = current_position.Y = 0;
|
startpoint.X = startpoint.Y = current_position.X = current_position.Y = 0;
|
||||||
|
|
@ -487,7 +479,8 @@ void process_gcode_command(GCODE_COMMAND *gcmd) {
|
||||||
SpecialMoveZ(-20L * STEPS_PER_MM_Z, SEARCH_FEEDRATE_Z);
|
SpecialMoveZ(-20L * STEPS_PER_MM_Z, SEARCH_FEEDRATE_Z);
|
||||||
|
|
||||||
// wait for queue to complete
|
// wait for queue to complete
|
||||||
for (;queue_empty(););
|
for (;queue_empty() == 0;)
|
||||||
|
wd_reset();
|
||||||
|
|
||||||
// this is our home point
|
// this is our home point
|
||||||
startpoint.Z = current_position.Z = 0;
|
startpoint.Z = current_position.Z = 0;
|
||||||
|
|
@ -601,13 +594,6 @@ void process_gcode_command(GCODE_COMMAND *gcmd) {
|
||||||
disable_heater();
|
disable_heater();
|
||||||
}
|
}
|
||||||
enqueue_temp_wait();
|
enqueue_temp_wait();
|
||||||
// while (!temp_achieved()) {
|
|
||||||
// ifclock(CLOCK_FLAG_250MS) {
|
|
||||||
// // this is cosmetically nasty, but exactly what needs to happen
|
|
||||||
// void clock_250ms(void);
|
|
||||||
// clock_250ms();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// M110- set line number
|
// M110- set line number
|
||||||
|
|
|
||||||
1
gcode.h
1
gcode.h
|
|
@ -61,7 +61,6 @@ typedef struct {
|
||||||
extern GCODE_COMMAND next_target;
|
extern GCODE_COMMAND next_target;
|
||||||
|
|
||||||
// utility functions
|
// utility functions
|
||||||
int8_t indexof(uint8_t c, const char *string);
|
|
||||||
int32_t decfloat_to_int(decfloat *df, int32_t multiplicand, int32_t denominator);
|
int32_t decfloat_to_int(decfloat *df, int32_t multiplicand, int32_t denominator);
|
||||||
|
|
||||||
// this is where we construct a move without a gcode command, useful for gcodes which require multiple moves eg; homing
|
// this is where we construct a move without a gcode command, useful for gcodes which require multiple moves eg; homing
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue