forked from upstream-mirrors/OpenTracks
Revision comments for rev 5bcaab17e76f addressed.
This commit is contained in:
@@ -48,13 +48,13 @@ public class StrideReadings {
|
||||
// TODO: Calibrate this using a reliable footpod / cadence sensor,
|
||||
// otherwise use heartbeat timestamp for calculation.
|
||||
strideReadingsHistory.add(0, numStrides);
|
||||
while(strideReadingsHistory.size() > NUM_READINGS_FOR_AVERAGE) {
|
||||
while (strideReadingsHistory.size() > NUM_READINGS_FOR_AVERAGE) {
|
||||
strideReadingsHistory.remove(strideReadingsHistory.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
public int getCadence() {
|
||||
if(strideReadingsHistory.size() < MIN_READINGS_FOR_AVERAGE) {
|
||||
if (strideReadingsHistory.size() < MIN_READINGS_FOR_AVERAGE) {
|
||||
// Bail out if we cannot really get a meaningful average yet.
|
||||
return CADENCE_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
+2
-2
@@ -76,8 +76,8 @@ public class ZephyrMessageParser implements MessageParser {
|
||||
}
|
||||
} else {
|
||||
cadence
|
||||
.setValue(SensorUtils.unsignedShortToIntLittleEndian(buffer, 56) / 16)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
.setValue(SensorUtils.unsignedShortToIntLittleEndian(buffer, 56) / 16)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
}
|
||||
sds.setCadence(cadence);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user