 void updateDisplay(TH *local, TH *external)
 {
   unsigned long totalOnMillis = systemState.accumulatedSystemMillis + (millis() - systemStart);
+
+  // TODO check for validity of internal (or external) data?
+  
   display.displayValues(local, 1, totalOnMillis);
   display.displayValues(external, 2, totalOnMillis - systemState.lastExternalValuesMillis);
 
+  systemState.displayedInternalTemperature = local->temperature;
+  systemState.displayedInternalHumidity = local->humidity;
+  
   // TODO consider age of shown data vs tempUpdateThreshold
 
   display.updatePartOrFull();

  bool shouldSleepNow = millis() - systemStart > systemAwakeSeconds * 1000;

  if (shouldSleepNow && !displayUpdated) {
    if (systemState.externalDataValid) {
      externalData.dataValid = true;
      externalData.temperature = systemState.lastExternalTemperature;
      externalData.humidity = systemState.lastExternalHumidity;
      updateVaporPressure(&externalData);
    }
    
    updateDisplay(&localData, &externalData);
  }

  unsigned long loopEnd = millis();


class SystemState : public CrcableData {
public:
  float displayedInternalTemperature = -100;
  float displayedInternalHumidity = -100;
  bool externalDataValid = false;
  float lastExternalTemperature = 0;
  float lastExternalHumidity = 0;
