Merge pull request #1309 from philfifi/fix_temp_runaway

temp runaway: proper cast to prevent any overflow.
This commit is contained in:
alexborro 2015-01-04 12:55:58 -02:00
commit d2b6e62996

View File

@ -1049,7 +1049,7 @@ void thermal_runaway_protection(int *state, unsigned long *timer, float temperat
{ {
*timer = millis(); *timer = millis();
} }
else if ( (millis() - *timer) > period_seconds*1000) else if ( (millis() - *timer) > ((unsigned long) period_seconds) * 1000)
{ {
SERIAL_ERROR_START; SERIAL_ERROR_START;
SERIAL_ERRORLNPGM("Thermal Runaway, system stopped! Heater_ID: "); SERIAL_ERRORLNPGM("Thermal Runaway, system stopped! Heater_ID: ");