 bool isBacklightAlwaysOn = false;
 
 float currentEnableThreshold;
-
-float getEnableThresholdFromEEProm(){
-  return DEFAULT_CURRENT_ENABLE_THRESHOLD;
-}
-
-void changeEnableThreshold(float newThreshold){
-  currentEnableThreshold = newThreshold;
-}
-
 
 void setup() {
 

#include <U8g2lib.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include "CTSensor.h"

#define DEFAULT_CURRENT_ENABLE_THRESHOLD 0.2
#define CURRENT_MCB_CUT 16

#define TEMP_MAX 85
#define TEMP_WARN 70

  }
}

float getEnableThresholdFromEEProm(){

  float value;

  EEPROM.get(ADDRESS_STORE_CURRENT_ENABLE, value);

  if(isnan(value)){
      return DEFAULT_CURRENT_ENABLE_THRESHOLD;
  } else {
    return value;
  }

}

void updateCurrentThresholdForCertainModes(){
  float newThreshold = currentEnableThreshold;

  if(isTopButtonPressed()){
    newThreshold += CURRENT_THRESHOLD_STRIDE;
  }

  if(isBottomButtonPressed()){
    newThreshold -= CURRENT_THRESHOLD_STRIDE;
  }


  if(newThreshold != currentEnableThreshold
    && newThreshold >= MIN_ENABLE_CURRENT_THRESHOLD){

    currentEnableThreshold = newThreshold;
    EEPROM.put(ADDRESS_STORE_CURRENT_ENABLE, currentEnableThreshold);
  }

}

