   20180511 M5Stack: WiFi OFF by default, config menu, C button as value accelerator
   20180528 Setting for trigger duration
   20180529 Preparatory work for timetable
+  20180601 Preparatory work for autofocus pin
   --------------------------------------------------*/
 #ifdef ESP32
 #include <M5Stack.h>

        }
    }
  }
  if ((timeTable != "" ) && (currentExecMode == TIMELAPSESTOP)) // Next element of timetable
    processTimeTable();
}

void processTimeTable()
{
	/*
  delayToStart = 0; // Reset wait (delay) timer anyway
  numberOfShots = 1; // At least one shot
  trigger(OFF);
  int idx = timeTable.indexOf(","); // Find end of next element
  while (idx >= 1)
  {
    String element = timeTable.substring(0, idx);
    if (element.length() >= 1) // something is there
    {
      int xPosition = element.indexOf("X");
      timeTable = timeTable.substring(idx + 1, timeTable.length()); // remove element from timetable
      if (element[0] == 'W') // set wait (=Delay) time
        delayToStart = atol(element.substring(1, element.length()).c_str());
      else if (element[0] == 'D') // Set trigger duration
        triggerDuration = atol(element.substring(1, element.length()).c_str());
      else if ((xPosition >= 1) && (element.length() >= 3)) // Number of shots and delay between shots in one element
      {
        numberOfShots = atol(element.substring(0, xPosition).c_str());
        delayBetweenShots = atol(element.substring(xPosition + 1, element.length()).c_str());
        break;
      }
      else // delay between shots only
      {
        delayBetweenShots = atol(element.substring(0, element.length()).c_str());
        break;
      }
    }
    idx = timeTable.indexOf(","); // Find end of next element
  }
  if (numberOfShots > 0)
    setAndDoProcessMode(TIMELAPSESTART);
	*/
}

void switchTriggerOffAndCheckStatus()

  trigger(OFF);
  currentTDuration = currentTriggerDuration;
  if ((currentNShots <= 0) && (currentExecMode == TIMELAPSERUNNING))  // End of Timelapse mode
  {
    currentExecMode = TIMELAPSESTOP;
    if (timeTable != "" )  // Next element of timetable
      processTimeTable();
  }
}

void extractParams(String params)
