 #ifdef SH1106_OLED_DRIVER
 Adafruit_SH1106 display(4);
 #endif
-uint8_t lastClick = NO_CLICK;
-uint8_t currentChannel = 0;
-uint8_t lastChannel = 0;
-uint8_t lastFunction = 255;
-uint8_t clickType = NO_CLICK;
-unsigned long pauseStart = 0;
+
+uint8_t  lastClick = NO_CLICK;
+uint8_t  currentChannel = 0;
+uint8_t  lastChannel = 0;
+uint8_t  clickType = NO_CLICK;
+uint8_t  ledState = LED_ON;
+uint8_t  alarmSoundOn = 0;
+uint8_t  options[MAX_OPTIONS];
+uint8_t  saveScreenActive = 0;
+uint8_t  softPositions[48];
+
 uint16_t currentRssi = 0;
-uint8_t ledState = LED_ON;
-unsigned long saveScreenTimer;
-unsigned long displayUpdateTimer = 0;
-unsigned long eepromSaveTimer = 0;
-unsigned long pulseTimer = 0;
-unsigned long alarmTimer = 0;
-uint8_t alarmSoundOn = 0;
 uint16_t alarmOnPeriod = 0;
 uint16_t alarmOffPeriod = 0;
-uint8_t options[MAX_OPTIONS];
-uint8_t saveScreenActive = 0;
-rtc6715 receiver( SPI_CLOCK_PIN, SLAVE_SELECT_PIN, SPI_DATA_PIN );
-unsigned char softPositions[48];
+uint32_t pauseStart = 0;
+uint32_t saveScreenTimer;
+
+uint32_t displayUpdateTimer = 0;
+uint32_t eepromSaveTimer = 0;
+uint32_t pulseTimer = 0;
+uint32_t alarmTimer = 0;
+
+rtc6715  receiver( SPI_CLOCK_PIN, SLAVE_SELECT_PIN, SPI_DATA_PIN );
 
 //******************************************************************************
 //* function: setup
 //******************************************************************************
 void setup()
 {
-  int i;
-
   // initialize LED pin
   pinMode(LED_PIN, OUTPUT);
   digitalWrite(LED_PIN, LED_ON);

//* function: updateSoftPositions
//******************************************************************************
void updateSoftPositions( void ) {
  unsigned char i;

  // Mark blocked channels in the softPositions array
  for (i = 0; i < 48; i++)

    return channel + 1;
}

uint8_t nextChannel(uint8_t channel)
{
  do {
    channel = incrementChannel( channel);
