tests: Make more tests run
This commit is contained in:
@@ -3,16 +3,17 @@
|
||||
#include "stepperDrv.hpp"
|
||||
#include "stepperMotor.hpp"
|
||||
#include <cmath>
|
||||
#include "syslog.hpp"
|
||||
#include "logging.hpp"
|
||||
|
||||
class WatchMotor {
|
||||
static constexpr uint8_t Positions = 6;
|
||||
|
||||
public:
|
||||
using AlmostFinishedCb = void (*)(uint8_t newIdx);
|
||||
WatchMotor(IStepperMotor &stepper, AlmostFinishedCb onDone)
|
||||
WatchMotor(IStepperMotor &stepper, AlmostFinishedCb onDone, ILogging &logger)
|
||||
: _stepper(stepper),
|
||||
_onFinCb(onDone) {
|
||||
_onFinCb(onDone),
|
||||
_logger(logger) {
|
||||
}
|
||||
|
||||
void moveTo(uint8_t position, uint8_t profile, int minJumps, float accel, float speed) {
|
||||
@@ -46,9 +47,9 @@ class WatchMotor {
|
||||
ESP_LOGD("MV", "Moving to %d by %.2f + %.2f", sign, delta, corr);
|
||||
|
||||
_stepper.moveBy(delta + corr, profile, accel, speed, [&](int diff) {
|
||||
Syslog::logv(Syslog::Severity::Debug,"Almost done with head=%i",diff);
|
||||
_logger.logv(ILogging::Severity::Debug,"Almost done with head=%i",diff);
|
||||
if (diff < 6) {
|
||||
Syslog::logv(Syslog::Severity::Warning,"Low headroom in Profile pipeline=%i",diff);
|
||||
_logger.logv(ILogging::Severity::Warning,"Low headroom in Profile pipeline=%i",diff);
|
||||
}
|
||||
|
||||
if (_onFinCb) {
|
||||
@@ -65,4 +66,5 @@ class WatchMotor {
|
||||
IStepperMotor &_stepper;
|
||||
uint8_t _currentIndex{};
|
||||
AlmostFinishedCb _onFinCb{};
|
||||
ILogging &_logger;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user