|
@@ -129,10 +129,10 @@ Stepper stepper; // Singleton
|
129
|
129
|
|
130
|
130
|
// private:
|
131
|
131
|
|
132
|
|
-block_t* Stepper::current_block = NULL; // A pointer to the block currently being traced
|
|
132
|
+block_t* Stepper::current_block; // (= NULL) A pointer to the block currently being traced
|
133
|
133
|
|
134
|
|
-uint8_t Stepper::last_direction_bits = 0,
|
135
|
|
- Stepper::axis_did_move;
|
|
134
|
+uint8_t Stepper::last_direction_bits, // = 0
|
|
135
|
+ Stepper::axis_did_move; // = 0
|
136
|
136
|
|
137
|
137
|
bool Stepper::abort_current_block;
|
138
|
138
|
|
|
@@ -2143,14 +2143,20 @@ void Stepper::init() {
|
2143
|
2143
|
E_AXIS_INIT(5);
|
2144
|
2144
|
#endif
|
2145
|
2145
|
|
2146
|
|
- set_directions();
|
2147
|
|
-
|
2148
|
2146
|
// Init Stepper ISR to 122 Hz for quick starting
|
2149
|
2147
|
HAL_timer_start(STEP_TIMER_NUM, 122);
|
2150
|
2148
|
|
2151
|
2149
|
ENABLE_STEPPER_DRIVER_INTERRUPT();
|
2152
|
2150
|
|
2153
|
2151
|
sei();
|
|
2152
|
+
|
|
2153
|
+ // Init direction bits for first moves
|
|
2154
|
+ last_direction_bits = 0
|
|
2155
|
+ | (INVERT_X_DIR ? _BV(X_AXIS) : 0)
|
|
2156
|
+ | (INVERT_Y_DIR ? _BV(Y_AXIS) : 0)
|
|
2157
|
+ | (INVERT_Z_DIR ? _BV(Z_AXIS) : 0);
|
|
2158
|
+
|
|
2159
|
+ set_directions();
|
2154
|
2160
|
}
|
2155
|
2161
|
|
2156
|
2162
|
/**
|