     linearBrightOfStep(0);
   }
   else {
-    unsigned long temp = totalDimmerSteps - totalDimmerSteps * delta / finalMillis;
+    uint32_t temp = totalDimmerSteps - totalDimmerSteps * delta / finalMillis;
     logisticBrightOfStep(temp);
   }
 }
 
 void updateBrightness()
 {
-  unsigned long modeActive = millis();
+  uint32_t modeActive = millis();
   bool normalExit = true;
   waitForButtonDepress(rotaryButton, LOW);
   while (debounceDigitalRead(rotaryButton) == HIGH) {

  }
}

const unsigned long clockUpdateInterval = 24 * 60 * 60 * 1000; // every 24 hours
unsigned long lastClockUpdate = millis();
void updateClockTime(bool force = false) {
  if (force || isTimeNow(lastClockUpdate, clockUpdateInterval)) {
    synchronized_clock_time = ClockTime(RTC.now());

  delay(1000);
  updateTimeDisplay(t, true, alarmMasterSwitchEnabled);
  waitForButtonDepress(TimeButton, LOW);
  uint32_t modeActive = millis();
  bool normalExit = true;
  while (debounceDigitalRead(TimeButton) == HIGH) {
    int16_t encoderDelta = encoder->getValue();
    updateTime(t, encoderDelta);
    modeActive = millis();
    if (static_cast<uint32_t>(millis() - modeActive) > modeInactivePeriod) {
      normalExit = false;
      break;
    }
