From 9b0dd2d63337de31141f65d4edfe2aa26255a874 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 12 Jul 2021 09:58:53 +0200 Subject: [PATCH] Motion: fix new Step() prototype --- src/modules/motion.cpp | 4 +++- src/modules/motion.h | 1 + tests/unit/logic/stubs/stub_motion.cpp | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/motion.cpp b/src/modules/motion.cpp index fcbe784..a902f7a 100644 --- a/src/modules/motion.cpp +++ b/src/modules/motion.cpp @@ -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() {} diff --git a/src/modules/motion.h b/src/modules/motion.h index 0b78929..fcc3132 100644 --- a/src/modules/motion.h +++ b/src/modules/motion.h @@ -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 diff --git a/tests/unit/logic/stubs/stub_motion.cpp b/tests/unit/logic/stubs/stub_motion.cpp index f7cd8e3..48fdf5f 100644 --- a/tests/unit/logic/stubs/stub_motion.cpp +++ b/tests/unit/logic/stubs/stub_motion.cpp @@ -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 {