Skip to content

Commit 5735f92

Browse files
surfdadolukash
authored andcommitted
Fix: ignore push start backwards if reverse stop is enabled
this prevents unintended re-engagements when trying to stop with rev-stop in some situations while push-start is also enabled Fix: ignore push start backwards if reverse stop is enabled
1 parent acf1f52 commit 5735f92

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,12 @@ static void refloat_thd(void *arg) {
10631063
if ((fabsf(d->imu.balance_pitch) < 45) && (fabsf(d->imu.roll) < 45)) {
10641064
// 45 to prevent board engaging when upright or laying sideways
10651065
// 45 degree tolerance is more than plenty for tricks / extreme mounts
1066-
engage(d);
1067-
break;
1066+
if (d->float_conf.fault_reversestop_enabled && d->motor.erpm < 0) {
1067+
// ignore push start backwards if reverse stop is enabled
1068+
} else {
1069+
engage(d);
1070+
break;
1071+
}
10681072
}
10691073
}
10701074

0 commit comments

Comments
 (0)