   }
 
   passFullCurrentThrough(true);
-
-  if(currentValue < CURRENT_ENABLE_THRESHOLD){
+  updateCurrentThresholdForCertainModes();
+
+  if(currentValue < currentEnableThreshold){
     return STATE_WINDOW_BEFORE;
   } else {
     return STATE_WINDOW_EXITED;
-  } 
+  }
 
 }
 
 STATE enterTempMaxMode(){
   if(currentState != STATE_TEMP_MAX){
     currentState = STATE_TEMP_MAX;
-    
+
     changeMCBRelayState(false);
     passFullCurrentThrough(false);
-    
+
     changeDisplayBacklight(true);
     shortBeepXTimesNoDelay(10);
     Serial.println("Enter Max Temp mode");


bool isBacklightAlwaysOn = false;

void setup() {

  pinMode(PIN_LED, OUTPUT);
  pinMode(PIN_BUZZER, OUTPUT);

#define NUM_CT_SAMPLES 275

//Delay between LCD Print to avoid slowing down data collection
#define INTERVAL_PRINT 300

#define BACKLIGHT_BLINK_RATE 200

