Motion: fix new Step() prototype

pull/47/head
Yuri D'Elia 2021-07-12 09:58:53 +02:00
parent 9b77623be1
commit 9b0dd2d633
3 changed files with 6 additions and 2 deletions

View File

@ -55,7 +55,9 @@ void Motion::AbortPlannedMoves() {
axisData[i].ctrl.AbortPlannedMoves();
}
st_timer_t Motion::Step() {}
st_timer_t Motion::Step() {
return 0;
}
void ISR() {}

View File

@ -11,6 +11,7 @@ namespace motion {
using namespace hal::tmc2130;
using pulse_gen::pos_t;
using pulse_gen::st_timer_t;
using pulse_gen::steps_t;
/// Main axis enumeration

View File

@ -45,13 +45,14 @@ void Motion::Home(Axis axis, bool direction) {
void Motion::SetMode(Axis axis, hal::tmc2130::MotorMode mode) {
}
void Motion::Step() {
st_timer_t Motion::Step() {
for (uint8_t i = 0; i < 3; ++i) {
if (axes[i].pos != axes[i].targetPos) {
int8_t dirInc = (axes[i].pos < axes[i].targetPos) ? 1 : -1;
axes[i].pos += dirInc;
}
}
return 0;
}
bool Motion::QueueEmpty() const {