Skip to content

Commit 82f79c4

Browse files
surfdadoNicoAleman
authored andcommitted
Odometer fix: allow setting odometer to lower values
Signed-off-by: Dado Mista <dadomista@gmail.com>
1 parent ba24db2 commit 82f79c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

float/float/float.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ static void check_odometer(data *d)
596596
{
597597
// Make odometer persistent if we've gone 200m or more
598598
if (d->odometer_dirty > 0) {
599-
if (VESC_IF->mc_get_odometer() > d->odometer + 200) {
599+
float stored_odo = VESC_IF->mc_get_odometer();
600+
if ((stored_odo > d->odometer + 200) || (stored_odo < d->odometer - 10000)) {
600601
if (d->odometer_dirty == 1) {
601602
// Wait 10 seconds before writing to avoid writing if immediately continuing to ride
602603
d->odo_timer = d->current_time;

float/ui.qml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ Item {
676676
}
677677
Text {
678678
id: versionText
679-
text: "{{VERSION}}"
679+
text: "{{VERSION}}b"
680680
color: Utility.getAppHexColor("lightText")
681681
font.pointSize: 10
682682
font.weight: Font.Black

0 commit comments

Comments
 (0)