Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Update SensorDataCyclingCadence.java
Browse files Browse the repository at this point in the history
Renamed this field "TAG" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
  • Loading branch information
bhavya-bugude authored Oct 13, 2023
1 parent b3dbf20 commit 732095a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public void compute(SensorDataCyclingCadence previous) {
float timeDiff_ms = UintUtils.diff(crankRevolutionsTime, previous.crankRevolutionsTime, UintUtils.UINT16_MAX) / 1024f * 1000;
Duration timeDiff = Duration.ofMillis((long) timeDiff_ms);
if (timeDiff.isZero() || timeDiff.isNegative()) {
Log.e(TAG, "Timestamps difference is invalid: cannot compute cadence.");
Log.e(tAG, "Timestamps difference is invalid: cannot compute cadence.");
value = null;
return;
}

// TODO We have to treat with overflow according to the documentation: read https://github.com/OpenTracksApp/OpenTracks/pull/953#discussion_r711625268
if (crankRevolutionsCount < previous.crankRevolutionsCount) {
Log.e(TAG, "Crank revolutions count difference is invalid: cannot compute cadence.");
Log.e(tAG, "Crank revolutions count difference is invalid: cannot compute cadence.");
return;
}

Expand Down

0 comments on commit 732095a

Please sign in to comment.