 #define modeManualClose 4
 #define modeHalt 5
 
-unsigned long ms, motorStartTime;
+unsigned long ms, motorStartTime, manualModeReleaseTime;
+bool outputRequired = false;
 
 int currentMode = modeWait;
 int previousMode = modeWait;

  This auto-presses the open or close buttons for the convertible top on a Porsche 986
  for the specified open/close seconds automatically if you quickly tap the button.

  If the button tap is longer (eg it is held down), the button reacts like normal
  and is only auto-pressed for the same amount of time as the user is pressing.

  If the top is already automatically opening or closing, a second press of either
  button cancels the auto-open proceedure.


void updateMode() {

  previousMode = currentMode;

  switch (currentMode) {

    case modeWait:
