|
@@ -109,10 +109,10 @@ int16_t Stepper::cleaning_buffer_counter = 0;
|
109
|
109
|
bool Stepper::locked_z_motor = false, Stepper::locked_z2_motor = false;
|
110
|
110
|
#endif
|
111
|
111
|
|
112
|
|
-long Stepper::counter_X = 0,
|
113
|
|
- Stepper::counter_Y = 0,
|
114
|
|
- Stepper::counter_Z = 0,
|
115
|
|
- Stepper::counter_E = 0;
|
|
112
|
+int32_t Stepper::counter_X = 0,
|
|
113
|
+ Stepper::counter_Y = 0,
|
|
114
|
+ Stepper::counter_Z = 0,
|
|
115
|
+ Stepper::counter_E = 0;
|
116
|
116
|
|
117
|
117
|
volatile uint32_t Stepper::step_events_completed = 0; // The number of step events executed in the current block
|
118
|
118
|
|
|
@@ -159,7 +159,7 @@ volatile int32_t Stepper::count_position[NUM_AXIS] = { 0 };
|
159
|
159
|
volatile signed char Stepper::count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
|
160
|
160
|
|
161
|
161
|
#if ENABLED(MIXING_EXTRUDER)
|
162
|
|
- long Stepper::counter_m[MIXING_STEPPERS];
|
|
162
|
+ int32_t Stepper::counter_m[MIXING_STEPPERS];
|
163
|
163
|
#endif
|
164
|
164
|
|
165
|
165
|
uint8_t Stepper::step_loops, Stepper::step_loops_nominal;
|
|
@@ -169,7 +169,7 @@ hal_timer_t Stepper::OCR1A_nominal;
|
169
|
169
|
hal_timer_t Stepper::acc_step_rate; // needed for deceleration start point
|
170
|
170
|
#endif
|
171
|
171
|
|
172
|
|
-volatile long Stepper::endstops_trigsteps[XYZ];
|
|
172
|
+volatile int32_t Stepper::endstops_trigsteps[XYZ];
|
173
|
173
|
|
174
|
174
|
#if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
|
175
|
175
|
#define LOCKED_X_MOTOR locked_x_motor
|
|
@@ -1976,7 +1976,7 @@ void Stepper::synchronize() { while (planner.has_blocks_queued() || cleaning_buf
|
1976
|
1976
|
* This allows get_axis_position_mm to correctly
|
1977
|
1977
|
* derive the current XYZ position later on.
|
1978
|
1978
|
*/
|
1979
|
|
-void Stepper::set_position(const long &a, const long &b, const long &c, const long &e) {
|
|
1979
|
+void Stepper::set_position(const int32_t &a, const int32_t &b, const int32_t &c, const int32_t &e) {
|
1980
|
1980
|
|
1981
|
1981
|
synchronize(); // Bad to set stepper counts in the middle of a move
|
1982
|
1982
|
|
|
@@ -2009,13 +2009,13 @@ void Stepper::set_position(const long &a, const long &b, const long &c, const lo
|
2009
|
2009
|
CRITICAL_SECTION_END;
|
2010
|
2010
|
}
|
2011
|
2011
|
|
2012
|
|
-void Stepper::set_position(const AxisEnum &axis, const long &v) {
|
|
2012
|
+void Stepper::set_position(const AxisEnum &axis, const int32_t &v) {
|
2013
|
2013
|
CRITICAL_SECTION_START;
|
2014
|
2014
|
count_position[axis] = v;
|
2015
|
2015
|
CRITICAL_SECTION_END;
|
2016
|
2016
|
}
|
2017
|
2017
|
|
2018
|
|
-void Stepper::set_e_position(const long &e) {
|
|
2018
|
+void Stepper::set_e_position(const int32_t &e) {
|
2019
|
2019
|
CRITICAL_SECTION_START;
|
2020
|
2020
|
count_position[E_AXIS] = e;
|
2021
|
2021
|
CRITICAL_SECTION_END;
|
|
@@ -2024,9 +2024,9 @@ void Stepper::set_e_position(const long &e) {
|
2024
|
2024
|
/**
|
2025
|
2025
|
* Get a stepper's position in steps.
|
2026
|
2026
|
*/
|
2027
|
|
-long Stepper::position(const AxisEnum axis) {
|
|
2027
|
+int32_t Stepper::position(const AxisEnum axis) {
|
2028
|
2028
|
CRITICAL_SECTION_START;
|
2029
|
|
- const long count_pos = count_position[axis];
|
|
2029
|
+ const int32_t count_pos = count_position[axis];
|
2030
|
2030
|
CRITICAL_SECTION_END;
|
2031
|
2031
|
return count_pos;
|
2032
|
2032
|
}
|
|
@@ -2095,9 +2095,9 @@ void Stepper::endstop_triggered(const AxisEnum axis) {
|
2095
|
2095
|
|
2096
|
2096
|
void Stepper::report_positions() {
|
2097
|
2097
|
CRITICAL_SECTION_START;
|
2098
|
|
- const long xpos = count_position[X_AXIS],
|
2099
|
|
- ypos = count_position[Y_AXIS],
|
2100
|
|
- zpos = count_position[Z_AXIS];
|
|
2098
|
+ const int32_t xpos = count_position[X_AXIS],
|
|
2099
|
+ ypos = count_position[Y_AXIS],
|
|
2100
|
+ zpos = count_position[Z_AXIS];
|
2101
|
2101
|
CRITICAL_SECTION_END;
|
2102
|
2102
|
|
2103
|
2103
|
#if CORE_IS_XY || CORE_IS_XZ || IS_DELTA || IS_SCARA
|