Skip to content

Commit

Permalink
solve uninitialized variable error on esp32
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Unger committed Sep 23, 2023
1 parent 081cdd4 commit ecb3866
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/motors/HybridStepperMotor/HybridStepperMotor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ void HybridStepperMotor::setPhaseVoltage(float Uq, float Ud, float angle_el)
case 7:
center = (driver->voltage_limit - 0 - Ub) / 2;
break;

default: // this case does not occur, but compilers complain about uninitialized variables
center = (driver->voltage_limit - 0) / 2;
break;
}

Ua += center;
Expand Down

0 comments on commit ecb3866

Please sign in to comment.