diff --git a/config.h.dist b/config.h.dist index e97d397..4eb00d2 100644 --- a/config.h.dist +++ b/config.h.dist @@ -180,12 +180,6 @@ // -------------------------------------------------------------------------- // you shouldn't need to edit anything below this line -// same as above with 25.4 scale factor -#define STEPS_PER_IN_X ((uint32_t) ((25.4 * STEPS_PER_MM_X) + 0.5)) -#define STEPS_PER_IN_Y ((uint32_t) ((25.4 * STEPS_PER_MM_Y) + 0.5)) -#define STEPS_PER_IN_Z ((uint32_t) ((25.4 * STEPS_PER_MM_Z) + 0.5)) -#define STEPS_PER_IN_E ((uint32_t) ((25.4 * STEPS_PER_MM_E) + 0.5)) - // inverse, used in distance calculation during DDA setup #define UM_PER_STEP_X ((uint32_t) ((1000.0 / STEPS_PER_MM_X) + 0.5)) #define UM_PER_STEP_Y ((uint32_t) ((1000.0 / STEPS_PER_MM_Y) + 0.5)) diff --git a/gcode.c b/gcode.c index aa8a1c2..3a83e93 100644 --- a/gcode.c +++ b/gcode.c @@ -15,6 +15,14 @@ #include "heater.h" #include "sersendf.h" +/* + mm -> inch conversion +*/ +#define STEPS_PER_IN_X ((uint32_t) ((25.4 * STEPS_PER_MM_X) + 0.5)) +#define STEPS_PER_IN_Y ((uint32_t) ((25.4 * STEPS_PER_MM_Y) + 0.5)) +#define STEPS_PER_IN_Z ((uint32_t) ((25.4 * STEPS_PER_MM_Z) + 0.5)) +#define STEPS_PER_IN_E ((uint32_t) ((25.4 * STEPS_PER_MM_E) + 0.5)) + uint8_t last_field = 0; #define crc(a, b) (a ^ b)