 //******************************************************************************
 //* Other file scope variables
 unsigned char lastClick = NO_CLICK;
+unsigned char clickType = NO_CLICK;
 unsigned char currentChannel = 0;
 unsigned char lastChannel = 0;
 unsigned char ledState = LED_ON;
+unsigned long pauseStart = 0;
 unsigned long displayUpdateTimer = 0;
 unsigned long eepromSaveTimer = 0;
 unsigned long forceDisplayTimer = 0;

}

//******************************************************************************
//* function: get_click_type
//*         : Polls the specified pin and returns the type of click that was
//*         : performed NO_CLICK, SINGLE_CLICK, DOUBLE_CLICK, LONG_CLICK,
//*         : LONG_LONG_CLICK or WAKEUP_CLICK
//******************************************************************************
unsigned char getClickType(unsigned char buttonPin) {
  unsigned int timer = 0;
  unsigned char click_type = NO_CLICK;

  // check if the key has been pressed
  if (digitalRead(buttonPin) == !BUTTON_PRESSED)
    return ( NO_CLICK );

  while (digitalRead(buttonPin) == BUTTON_PRESSED) {
    timer++;
    delay(5);
  }
  if (timer < 120)                  // 120 * 5 ms = 0.6s
    click_type = SINGLE_CLICK;
  if (timer >= 80 && timer < 300 )  // 300 * 5 ms = 1.5s
    click_type = LONG_CLICK;
  if (timer >= 300)
    click_type = LONG_LONG_CLICK;

  // If the screen saver is active a short key press is just a wakeup call
  if (saveScreenActive) {
    saveScreenActive = 0;
    if ( click_type == SINGLE_CLICK )
      return ( WAKEUP_CLICK );
  }

  // Check if there is a second click
  timer = 0;
  while ((digitalRead(buttonPin) == !BUTTON_PRESSED) && (timer++ < 40)) {
    delay(5);
  }
  if (timer >= 40)                  // 40 * 5 ms = 0.2s
    return click_type;

  if (digitalRead(buttonPin) == BUTTON_PRESSED ) {
    click_type = DOUBLE_CLICK;
    while (digitalRead(buttonPin) == BUTTON_PRESSED) ;
  }
  return (click_type);
}

//******************************************************************************

  digitalWrite(LED_PIN, LED_ON);

  // initialize button pin
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  enableInterrupt(BUTTON_PIN, buttonPressInterrupt, CHANGE);

  // initialize alarm
  pinMode(ALARM_PIN, OUTPUT );
