|
@@ -1069,15 +1069,17 @@ void babystep(const uint8_t axis,const bool direction)
|
1069
|
1069
|
#endif
|
1070
|
1070
|
|
1071
|
1071
|
}
|
1072
|
|
- break;
|
|
1072
|
+ break;
|
|
1073
|
+
|
|
1074
|
+#ifndef DELTA
|
1073
|
1075
|
case Z_AXIS:
|
1074
|
1076
|
{
|
1075
|
1077
|
enable_z();
|
1076
|
1078
|
uint8_t old_z_dir_pin= READ(Z_DIR_PIN); //if dualzstepper, both point to same direction.
|
1077
|
1079
|
//setup new step
|
1078
|
|
- WRITE(Z_DIR_PIN,(INVERT_Z_DIR)^direction);
|
|
1080
|
+ WRITE(Z_DIR_PIN,(INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z);
|
1079
|
1081
|
#ifdef Z_DUAL_STEPPER_DRIVERS
|
1080
|
|
- WRITE(Z2_DIR_PIN,(INVERT_Z_DIR)^direction);
|
|
1082
|
+ WRITE(Z2_DIR_PIN,(INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z);
|
1081
|
1083
|
#endif
|
1082
|
1084
|
//perform step
|
1083
|
1085
|
WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
|
@@ -1101,6 +1103,41 @@ void babystep(const uint8_t axis,const bool direction)
|
1101
|
1103
|
|
1102
|
1104
|
}
|
1103
|
1105
|
break;
|
|
1106
|
+#else //DELTA
|
|
1107
|
+ case Z_AXIS:
|
|
1108
|
+ {
|
|
1109
|
+ enable_x();
|
|
1110
|
+ enable_y();
|
|
1111
|
+ enable_z();
|
|
1112
|
+ uint8_t old_x_dir_pin= READ(X_DIR_PIN);
|
|
1113
|
+ uint8_t old_y_dir_pin= READ(Y_DIR_PIN);
|
|
1114
|
+ uint8_t old_z_dir_pin= READ(Z_DIR_PIN);
|
|
1115
|
+ //setup new step
|
|
1116
|
+ WRITE(X_DIR_PIN,(INVERT_X_DIR)^direction^BABYSTEP_INVERT_Z);
|
|
1117
|
+ WRITE(Y_DIR_PIN,(INVERT_Y_DIR)^direction^BABYSTEP_INVERT_Z);
|
|
1118
|
+ WRITE(Z_DIR_PIN,(INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z);
|
|
1119
|
+
|
|
1120
|
+ //perform step
|
|
1121
|
+ WRITE(X_STEP_PIN, !INVERT_X_STEP_PIN);
|
|
1122
|
+ WRITE(Y_STEP_PIN, !INVERT_Y_STEP_PIN);
|
|
1123
|
+ WRITE(Z_STEP_PIN, !INVERT_Z_STEP_PIN);
|
|
1124
|
+
|
|
1125
|
+ //wait a tiny bit
|
|
1126
|
+ {
|
|
1127
|
+ float x=1./float(axis+1); //absolutely useless
|
|
1128
|
+ }
|
|
1129
|
+ WRITE(X_STEP_PIN, INVERT_X_STEP_PIN);
|
|
1130
|
+ WRITE(Y_STEP_PIN, INVERT_Y_STEP_PIN);
|
|
1131
|
+ WRITE(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
|
1132
|
+
|
|
1133
|
+ //get old pin state back.
|
|
1134
|
+ WRITE(X_DIR_PIN,old_x_dir_pin);
|
|
1135
|
+ WRITE(Y_DIR_PIN,old_y_dir_pin);
|
|
1136
|
+ WRITE(Z_DIR_PIN,old_z_dir_pin);
|
|
1137
|
+
|
|
1138
|
+ }
|
|
1139
|
+ break;
|
|
1140
|
+#endif
|
1104
|
1141
|
|
1105
|
1142
|
default: break;
|
1106
|
1143
|
}
|