diff --git a/examples/ConsoleShell/ConsoleShell.ino b/examples/ConsoleShell/ConsoleShell.ino index e89469c..5e19d1d 100644 --- a/examples/ConsoleShell/ConsoleShell.ino +++ b/examples/ConsoleShell/ConsoleShell.ino @@ -140,7 +140,7 @@ void SetLedState() void SetBrightness() { // clamp value intervalOn on 0 and PWMinterval - intervalOn = max(min(ledBrightness,PWMinterval),0); + intervalOn = max(min((unsigned long)ledBrightness,PWMinterval),0ul); } // Pulse Width Modulation to vary Led intensity diff --git a/utility/HeaterSim.cpp b/utility/HeaterSim.cpp index 8c546c4..237acdd 100644 --- a/utility/HeaterSim.cpp +++ b/utility/HeaterSim.cpp @@ -70,7 +70,7 @@ void HeaterSim::CalcTemperature() { float rate = LN2/_halfTimeCooling; unsigned long currentTime = millis(); - if (currentTime >= _lastTime) _deltams = max(currentTime - _lastTime,1); + if (currentTime >= _lastTime) _deltams = max(currentTime - _lastTime,1ul); _deltaTime = _deltams/ 1000.0f; float deltaTemp = _boilerTemp - _ambientTemp; float deltaTempAfterCooling = deltaTemp*exp(-rate*_deltaTime);