Skip to content

Commit ecb3866

Browse files
author
Richard Unger
committed
solve uninitialized variable error on esp32
1 parent 081cdd4 commit ecb3866

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/motors/HybridStepperMotor/HybridStepperMotor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ void HybridStepperMotor::setPhaseVoltage(float Uq, float Ud, float angle_el)
453453
case 7:
454454
center = (driver->voltage_limit - 0 - Ub) / 2;
455455
break;
456+
457+
default: // this case does not occur, but compilers complain about uninitialized variables
458+
center = (driver->voltage_limit - 0) / 2;
459+
break;
456460
}
457461

458462
Ua += center;

0 commit comments

Comments
 (0)