Skip to content

Commit

Permalink
Cadence Dismatch issue among schwinn 270 console, QZ app and Zwift (I…
Browse files Browse the repository at this point in the history
…ssue #2366)
  • Loading branch information
cagnulein committed Jun 4, 2024
1 parent 61a6be9 commit 3644b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices/schwinn170bike/schwinn170bike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void schwinn170bike::characteristicChanged(const QLowEnergyCharacteristic &chara
double current = ((double)(((uint16_t)((uint8_t)newValue.at(5)) << 8) | (uint16_t)((uint8_t)newValue.at(4))));
if (current != lastCadenceValue) {
QDateTime now = QDateTime::currentDateTime();
double c = ((current - lastCadenceValue) / (now.msecsTo(lastCadenceChanged))) * 60000.0;
double c = ((current - lastCadenceValue) / fabs(now.msecsTo(lastCadenceChanged))) * 60000.0;
lastCadenceValue = current;
lastCadenceChanged = now;
if (c < 255) {
Expand Down

0 comments on commit 3644b70

Please sign in to comment.