prevent Crash if pulsePerRev is set to 0
This commit is contained in:
parent
c593b8a546
commit
0bc7d0862b
@ -609,9 +609,10 @@ void SystemShutdown()
|
||||
|
||||
uint32_t Process_Impulse_WheelSpeed()
|
||||
{
|
||||
uint32_t add_milimeters;
|
||||
uint32_t add_milimeters = 0;
|
||||
// Calculate traveled Distance in mm
|
||||
add_milimeters = (wheel_pulse * (LubeConfig.DistancePerRevolution_mm / LubeConfig.PulsePerRevolution));
|
||||
if (LubeConfig.PulsePerRevolution != 0)
|
||||
add_milimeters = (wheel_pulse * (LubeConfig.DistancePerRevolution_mm / LubeConfig.PulsePerRevolution));
|
||||
|
||||
if (globals.measurementActive == true)
|
||||
globals.measuredPulses = globals.measuredPulses + wheel_pulse;
|
||||
|
Loading…
x
Reference in New Issue
Block a user