Skip to content

Commit

Permalink
Sole F63 doesn't work with qz #597
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Oct 27, 2023
1 parent ba92532 commit 4da2ac2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/solef80treadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,18 @@ void solef80treadmill::update() {
}
} while (requestSpeed != -1 && sole_treadmill_inclination_fast && max_speed_loop);

int max_inclination_loop = 0;
if(requestInclination != -100) {
max_inclination_loop = abs(requestInclination - (int)currentInclination().value());
}
do {
if (requestInclination != -100) {
if (requestInclination < 0)
requestInclination = 0;
// this treadmill has only 1% step inclination
if ((int)requestInclination != (int)currentInclination().value() && requestInclination >= 0 &&
requestInclination <= 15) {
emit debug(QStringLiteral("writing incline ") + QString::number(requestInclination));
emit debug(QStringLiteral("writing incline ") + QString::number(requestInclination) + " " + QString::number(max_inclination_loop)));
forceIncline(requestInclination);
} else if ((int)requestInclination == (int)currentInclination().value()) {
qDebug() << "int inclination match the current one" << requestInclination
Expand All @@ -345,7 +349,7 @@ void solef80treadmill::update() {
// i have to do the reset on when the inclination is equal to the current
// requestInclination = -100;
}
} while (requestInclination != -100 && sole_treadmill_inclination_fast);
} while (requestInclination != -100 && sole_treadmill_inclination_fast && max_inclination_loop);

if (requestStart != -1) {
emit debug(QStringLiteral("starting..."));
Expand Down

0 comments on commit 4da2ac2

Please sign in to comment.