   if(currentValue < CURRENT_ENABLE_THRESHOLD){
     return STATE_WINDOW_BEFORE;
   } else if((currentTime - enableWindowTime) >= DELAY_BEFORE_LIMITER_RELAY_ENABLE){
+    //Exit window if no overcurrent is detected in this time
     return STATE_WINDOW_EXITED;
   } else {
     return STATE_WINDOW_WITHIN;

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

#define CURRENT_ENABLE_THRESHOLD 0.2
#define CURRENT_MCB_CUT 16

#define PIN_LED 26


STATE enterWindowWithinMode(double currentValue){
  unsigned long currentTime = millis();

  static unsigned long enableWindowTime = 0;
  
  if(currentState != STATE_WINDOW_WITHIN){
    currentState = STATE_WINDOW_WITHIN;
