 uint16_t readRSSI()
 {
 #ifdef USE_DIVERSITY
-  return readRSSI(-1);
+    return readRSSI(-1);
 }
 uint16_t readRSSI(char receiver)
 {
 #endif
-  int rssi = 0;
-  int rssiA = 0;
-
-#ifdef USE_DIVERSITY
-  int rssiB = 0;
-#endif
-  for (uint8_t i = 0; i < RSSI_READS; i++)
-  {
-    analogRead(rssiPinA);
-    rssiA += analogRead(rssiPinA);//random(RSSI_MAX_VAL-200, RSSI_MAX_VAL);//
-
-#ifdef USE_DIVERSITY
-    analogRead(rssiPinB);
-    rssiB += analogRead(rssiPinB);//random(RSSI_MAX_VAL-200, RSSI_MAX_VAL);//
+    int rssi = 0;
+    int rssiA = 0;
+
+#ifdef USE_DIVERSITY
+    int rssiB = 0;
+#endif
+    for (uint8_t i = 0; i < RSSI_READS; i++)  {
+        analogRead(rssiPinA);
+        rssiA += analogRead(rssiPinA);//random(RSSI_MAX_VAL-200, RSSI_MAX_VAL);//
+
+#ifdef USE_DIVERSITY
+        analogRead(rssiPinB);
+        rssiB += analogRead(rssiPinB);//random(RSSI_MAX_VAL-200, RSSI_MAX_VAL);//
 #endif
 
 
 
 #ifdef Debug
-    rssiB += 1;// random(RSSI_MAX_VAL - 200, RSSI_MAX_VAL); //
-#endif
-
-
-  }
-  rssiA = rssiA / RSSI_READS; // average of RSSI_READS readings
-
-#ifdef USE_DIVERSITY
-  rssiB = rssiB / RSSI_READS; // average of RSSI_READS readings
-#endif
-  // special case for RSSI setup
-  if (state == STATE_RSSI_SETUP)
-  { // RSSI setup
-    if (rssiA < rssi_setup_min_a)
-    {
-      rssi_setup_min_a = rssiA;
-    }
-    if (rssiA > rssi_setup_max_a)
-    {
-      rssi_setup_max_a = rssiA;
-    }
-
-#ifdef USE_DIVERSITY
-    if (rssiB < rssi_setup_min_b)
-    {
-      rssi_setup_min_b = rssiB;
-    }
-    if (rssiB > rssi_setup_max_b)
-    {
-      rssi_setup_max_b = rssiB;
-    }
-#endif
-  }
-
-  rssiA = map(rssiA, rssi_min_a, rssi_max_a , 1, 100);   // scale from 1..100%
-#ifdef USE_DIVERSITY
-  rssiB = map(rssiB, rssi_min_b, rssi_max_b , 1, 100);   // scale from 1..100%
-  if (receiver == -1) // no receiver was chosen using diversity
-  {
-    switch (diversity_mode)
-    {
-      case useReceiverAuto:
-        // select receiver
-        if ((int)abs((float)(((float)rssiA - (float)rssiB) / (float)rssiB) * 100.0) >= DIVERSITY_CUTOVER)
-        {
-          if (rssiA > rssiB && diversity_check_count > 0)
-          {
-            diversity_check_count--;
-          }
-          if (rssiA < rssiB && diversity_check_count < DIVERSITY_MAX_CHECKS)
-          {
-            diversity_check_count++;
-          }
-          // have we reached the maximum number of checks to switch receivers?
-          if (diversity_check_count == 0 || diversity_check_count >= DIVERSITY_MAX_CHECKS) {
-            receiver = (diversity_check_count == 0) ? useReceiverA : useReceiverB;
-          }
-          else {
-            receiver = active_receiver;
-          }
-        }
-        else {
-          receiver = active_receiver;
-        }
-        break;
-      case useReceiverB:
-        receiver = useReceiverB;
-        break;
-      case useReceiverA:
-      default:
-        receiver = useReceiverA;
-    }
+        rssiB += 1;// random(RSSI_MAX_VAL - 200, RSSI_MAX_VAL); //
+#endif
+
+
+    }
+    rssiA = rssiA / RSSI_READS; // average of RSSI_READS readings
+
+#ifdef USE_DIVERSITY
+    rssiB = rssiB / RSSI_READS; // average of RSSI_READS readings
+#endif
+    // special case for RSSI setup
+    if (state == STATE_RSSI_SETUP)  { // RSSI setup
+        if (rssiA < rssi_setup_min_a)    {
+            rssi_setup_min_a = rssiA;
+        }
+        if (rssiA > rssi_setup_max_a)    {
+            rssi_setup_max_a = rssiA;
+        }
+
+#ifdef USE_DIVERSITY
+        if (rssiB < rssi_setup_min_b)    {
+            rssi_setup_min_b = rssiB;
+        }
+        if (rssiB > rssi_setup_max_b)    {
+            rssi_setup_max_b = rssiB;
+        }
+#endif
+    }
+
+    rssiA = map(rssiA, rssi_min_a, rssi_max_a , 1, 100);   // scale from 1..100%
+#ifdef USE_DIVERSITY
+    rssiB = map(rssiB, rssi_min_b, rssi_max_b , 1, 100);   // scale from 1..100%
+    if (receiver == -1) // no receiver was chosen using diversity  {
+        switch (diversity_mode)    {
+        case useReceiverAuto:
+            // select receiver
+            if ((int)abs((float)(((float)rssiA - (float)rssiB) / (float)rssiB) * 100.0) >= DIVERSITY_CUTOVER)        {
+                if (rssiA > rssiB && diversity_check_count > 0)          {
+                    diversity_check_count--;
+                }
+                if (rssiA < rssiB && diversity_check_count < DIVERSITY_MAX_CHECKS)          {
+                    diversity_check_count++;
+                }
+                // have we reached the maximum number of checks to switch receivers?
+                if (diversity_check_count == 0 || diversity_check_count >= DIVERSITY_MAX_CHECKS) {
+                    receiver = (diversity_check_count == 0) ? useReceiverA : useReceiverB;
+                }
+                else {
+                    receiver = active_receiver;
+                }
+            }
+            else {
+                receiver = active_receiver;
+            }
+            break;
+        case useReceiverB:
+            receiver = useReceiverB;
+            break;
+        case useReceiverA:
+        default:
+            receiver = useReceiverA;
+        }
     // set the antenna LED and switch the video
     setReceiver(receiver);
-  }
-#endif
-
-#ifdef USE_DIVERSITY
-  if (receiver == useReceiverA || state == STATE_RSSI_SETUP)
-  {
+}
+#endif
+
+#ifdef USE_DIVERSITY
+if (receiver == useReceiverA || state == STATE_RSSI_SETUP)  {
 #endif
     rssi = rssiA;
 #ifdef USE_DIVERSITY
-  }
-  else {
+}  else {
     rssi = rssiB;
-  }
-#endif
-
-
-  //SEND RSSI FEEDBACK
-  if ( (( time_screen_saver2 != 0 &&  time_screen_saver2 + 8000 < millis()))   && (  state == STATE_SCREEN_SAVER) )
-  {
-    if ((p_active_receiver != active_receiver )  || ((rssi - 60 > p_rssi) ||  (rssi + 60 < p_rssi)))
-    { p_active_receiver = active_receiver;
-      p_rssi = rssi ;
-      OSDParams[0] = rssiA; //rssiA; //this is  A
-      OSDParams[1] = rssiB; //rssiB; //this is  B
-      OSDParams[2] = receiver; //active_receiver; //CUrrent reciever
-      OSDParams[3] = -1; //THIS is for rssi method
-      SendToOSD();
-      time_screen_saver2 = 1;
-    }
-  }
-
-  return constrain(rssi, 1, 100); // clip values to only be within this range.
+}
+#endif
+
+
+//SEND RSSI FEEDBACK
+if ( (( time_screen_saver2 != 0 &&  time_screen_saver2 + 8000 < millis()))   && (  state == STATE_SCREEN_SAVER) )  {
+    if ((p_active_receiver != active_receiver )  || ((rssi - 60 > p_rssi) ||  (rssi + 60 < p_rssi)))     {
+        p_active_receiver = active_receiver;
+        p_rssi = rssi ;
+        OSDParams[0] = rssiA; //rssiA; //this is  A
+        OSDParams[1] = rssiB; //rssiB; //this is  B
+        OSDParams[2] = receiver; //active_receiver; //CUrrent reciever
+        OSDParams[3] = -1; //THIS is for rssi method
+        SendToOSD();
+        time_screen_saver2 = 1;
+    }
+}
+
+return constrain(rssi, 1, 100); // clip values to only be within this range.
 }
 
 void setReceiver(uint8_t receiver) {
 #ifdef USE_DIVERSITY
-  if (receiver == useReceiverA)
-  {
+    if (receiver == useReceiverA)  {
 #ifdef USE_FAST_SWITCHING
-    PORTC = (PORTC & B11111101) | B00000001; //This turns off receiverB_led and turns on receiverA_led simultaniously, this does however breaks the adaptability of receiverA_led/receiverB_led in settings.h
+        PORTC = (PORTC & B11111101) | B00000001; //This turns off receiverB_led and turns on receiverA_led simultaniously, this does however breaks the adaptability of receiverA_led/receiverB_led in settings.h
 #else
-    digitalWrite(receiverB_led, LOW);
-    digitalWrite(receiverA_led, HIGH);
-#endif
-  }
-  else
-  {
-#ifdef USE_FAST_SWITCHING
-    PORTC = (PORTC & B11111110) | B00000010; //This turns off receiverA_led and turns on receiverB_led simultaniously
-#else
-    digitalWrite(receiverA_led, LOW);
-    digitalWrite(receiverB_led, HIGH);
-#endif
-  }
-#else
-  digitalWrite(receiverA_led, HIGH);
-#endif
-
-  active_receiver = receiver;
-}
-
-
-
-void setChannelModule(uint8_t channel)
-{
-  uint8_t i;
-  uint16_t channelData;
-
-  channelData = pgm_read_word_near(channelTable + channel);
-
-  // bit bash out 25 bits of data
-  // Order: A0-3, !R/W, D0-D19
-  // A0=0, A1=0, A2=0, A3=1, RW=0, D0-19=0
-  SERIAL_ENABLE_HIGH();
-  delayMicroseconds(1);
-  //delay(2);
-  SERIAL_ENABLE_LOW();
-
-  SERIAL_SENDBIT0();
-  SERIAL_SENDBIT0();
-  SERIAL_SENDBIT0();
-  SERIAL_SENDBIT1();
-
-  SERIAL_SENDBIT0();
-
-  // remaining zeros
-  for (i = 20; i > 0; i--)
-    SERIAL_SENDBIT0();
-
-  // Clock the data in
-  SERIAL_ENABLE_HIGH();
-  //delay(2);
-  delayMicroseconds(1);
-  SERIAL_ENABLE_LOW();
-
-  // Second is the channel data from the lookup table
-  // 20 bytes of register data are sent, but the MSB 4 bits are zeros
-  // register address = 0x1, write, data0-15=channelData data15-19=0x0
-  SERIAL_ENABLE_HIGH();
-  SERIAL_ENABLE_LOW();
-
-  // Register 0x1
-  SERIAL_SENDBIT1();
-  SERIAL_SENDBIT0();
-  SERIAL_SENDBIT0();
-  SERIAL_SENDBIT0();
-
-  // Write to register
-  SERIAL_SENDBIT1();
-
-  // D0-D15
-  //   note: loop runs backwards as more efficent on AVR
-  for (i = 16; i > 0; i--)
-  {
-    // Is bit high or low?
-    if (channelData & 0x1)
-    {
-      SERIAL_SENDBIT1();
+        digitalWrite(receiverB_led, LOW);
+        digitalWrite(receiverA_led, HIGH);
+#endif
     }
     else
     {
-      SERIAL_SENDBIT0();
-    }
-
-    // Shift bits along to check the next one
-    channelData >>= 1;
-  }
-
-  // Remaining D16-D19
-  for (i = 4; i > 0; i--)
+#ifdef USE_FAST_SWITCHING
+        PORTC = (PORTC & B11111110) | B00000010; //This turns off receiverA_led and turns on receiverB_led simultaniously
+#else
+        digitalWrite(receiverA_led, LOW);
+        digitalWrite(receiverB_led, HIGH);
+#endif
+    }
+#else
+    digitalWrite(receiverA_led, HIGH);
+#endif
+
+    active_receiver = receiver;
+}
+
+
+
+void setChannelModule(uint8_t channel) {
+    uint8_t i;
+    uint16_t channelData;
+
+    channelData = pgm_read_word_near(channelTable + channel);
+
+    // bit bash out 25 bits of data
+    // Order: A0-3, !R/W, D0-D19
+    // A0=0, A1=0, A2=0, A3=1, RW=0, D0-19=0
+    SERIAL_ENABLE_HIGH();
+    delayMicroseconds(1);
+    //delay(2);
+    SERIAL_ENABLE_LOW();
+
     SERIAL_SENDBIT0();
-
-  // Finished clocking data in
-  SERIAL_ENABLE_HIGH();
-  delayMicroseconds(1);
-  //delay(2);
-
-  digitalWrite(slaveSelectPin, LOW);
-  digitalWrite(spiClockPin, LOW);
-  digitalWrite(spiDataPin, LOW);
-}
-
-
-void SERIAL_SENDBIT1()
-{
-  digitalWrite(spiClockPin, LOW);
-  delayMicroseconds(1);
-
-  digitalWrite(spiDataPin, HIGH);
-  delayMicroseconds(1);
-  digitalWrite(spiClockPin, HIGH);
-  delayMicroseconds(1);
-
-  digitalWrite(spiClockPin, LOW);
-  delayMicroseconds(1);
-}
-
-void SERIAL_SENDBIT0()
-{
-  digitalWrite(spiClockPin, LOW);
-  delayMicroseconds(1);
-
-  digitalWrite(spiDataPin, LOW);
-  delayMicroseconds(1);
-  digitalWrite(spiClockPin, HIGH);
-  delayMicroseconds(1);
-
-  digitalWrite(spiClockPin, LOW);
-  delayMicroseconds(1);
-}
-
-void SERIAL_ENABLE_LOW()
-{
-  delayMicroseconds(1);
-  digitalWrite(slaveSelectPin, LOW);
-  delayMicroseconds(1);
-}
-
-void SERIAL_ENABLE_HIGH()
-{
-  delayMicroseconds(1);
-  digitalWrite(slaveSelectPin, HIGH);
-  delayMicroseconds(1);
+    SERIAL_SENDBIT0();
+    SERIAL_SENDBIT0();
+    SERIAL_SENDBIT1();
+
+    SERIAL_SENDBIT0();
+
+    // remaining zeros
+    for (i = 20; i > 0; i--)
+        SERIAL_SENDBIT0();
+
+    // Clock the data in
+    SERIAL_ENABLE_HIGH();
+    //delay(2);
+    delayMicroseconds(1);
+    SERIAL_ENABLE_LOW();
+
+    // Second is the channel data from the lookup table
+    // 20 bytes of register data are sent, but the MSB 4 bits are zeros
+    // register address = 0x1, write, data0-15=channelData data15-19=0x0
+    SERIAL_ENABLE_HIGH();
+    SERIAL_ENABLE_LOW();
+
+    // Register 0x1
+    SERIAL_SENDBIT1();
+    SERIAL_SENDBIT0();
+    SERIAL_SENDBIT0();
+    SERIAL_SENDBIT0();
+
+    // Write to register
+    SERIAL_SENDBIT1();
+
+    // D0-D15
+    //   note: loop runs backwards as more efficent on AVR
+    for (i = 16; i > 0; i--)  {
+        // Is bit high or low?
+        if (channelData & 0x1)    {
+            SERIAL_SENDBIT1();
+        }
+        else    {
+            SERIAL_SENDBIT0();
+        }
+
+        // Shift bits along to check the next one
+        channelData >>= 1;
+    }
+
+    // Remaining D16-D19
+    for (i = 4; i > 0; i--)
+        SERIAL_SENDBIT0();
+
+    // Finished clocking data in
+    SERIAL_ENABLE_HIGH();
+    delayMicroseconds(1);
+    //delay(2);
+
+    digitalWrite(slaveSelectPin, LOW);
+    digitalWrite(spiClockPin, LOW);
+    digitalWrite(spiDataPin, LOW);
+}
+
+
+void SERIAL_SENDBIT1() {
+    digitalWrite(spiClockPin, LOW);
+    delayMicroseconds(1);
+
+    digitalWrite(spiDataPin, HIGH);
+    delayMicroseconds(1);
+    digitalWrite(spiClockPin, HIGH);
+    delayMicroseconds(1);
+
+    digitalWrite(spiClockPin, LOW);
+    delayMicroseconds(1);
+}
+
+void SERIAL_SENDBIT0() {
+    digitalWrite(spiClockPin, LOW);
+    delayMicroseconds(1);
+
+    digitalWrite(spiDataPin, LOW);
+    delayMicroseconds(1);
+    digitalWrite(spiClockPin, HIGH);
+    delayMicroseconds(1);
+
+    digitalWrite(spiClockPin, LOW);
+    delayMicroseconds(1);
+}
+
+void SERIAL_ENABLE_LOW() {
+    delayMicroseconds(1);
+    digitalWrite(slaveSelectPin, LOW);
+    delayMicroseconds(1);
+}
+
+void SERIAL_ENABLE_HIGH() {
+    delayMicroseconds(1);
+    digitalWrite(slaveSelectPin, HIGH);
+    delayMicroseconds(1);
 }
 
 
 void FillTemp_Tune_fav(int FavChannelx) {
-  for (int i = 0; i < 10; i++)
-  {
-    if ( temp_EEPROM_ADR_TUNE_FAV[i] == 255 && FavChannelx != 255) //not used  gc9n
-    {
-      temp_EEPROM_ADR_TUNE_FAV[i] = FavChannelx;
-      i = 12;
-    }
-
-  }
+    for (int i = 0; i < 10; i++)  {
+        if ( temp_EEPROM_ADR_TUNE_FAV[i] == 255 && FavChannelx != 255) //not used  gc9n    {
+            temp_EEPROM_ADR_TUNE_FAV[i] = FavChannelx;
+        i = 12;
+    }
+}
 }
 
 void SendToOSD() //GC9N
 {
-  if (settings_OSD == true || OSDParams[0] == -99 )
-  {
-    char one[5]  ;
-    char two[5] ;
-    char three[5] ;
-    char four[5] ;
-    char blank[5] = " " ;
-    char combined[20] = {0};
-
-
-    itoa(OSDParams[0], one, 10);
-    itoa(OSDParams[1], two, 10);
-    itoa(OSDParams[2], three, 10);
-    itoa(OSDParams[3], four, 10);
-
-    char ClearScreen[20] = " CLEAR ";
-    char RssiScreen[20] = " DRAWRSSI";
-
-    strcat(combined, OSDCommand);
-
-    if (OSDParams[0] == -99) // CLEARSCREEN
-    {
-      for (uint8_t i = 0; i < 20; i++)
-      {
-        combined[i] = ClearScreen[i];
-      }
-    }
-
-    if (OSDParams[3] == -1) // DRAW_RSSI
-    {
-      for (uint8_t i = 0; i < 20; i++)
-      {
-        combined[i] = RssiScreen[i];
-      }
-    }
-
-    strcat(combined, blank);
-    strcat(combined, one);
-    strcat(combined, blank);
-    strcat(combined, two);
-    strcat(combined, blank);
-    strcat(combined, three);
-
-
-    Serial.println(combined);
-    OSDParams[3] = 0;
-
-  }
+    if (settings_OSD == true || OSDParams[0] == -99 )  {
+        char one[5]  ;
+        char two[5] ;
+        char three[5] ;
+        char four[5] ;
+        char blank[5] = " " ;
+        char combined[20] = {0};
+
+
+        itoa(OSDParams[0], one, 10);
+        itoa(OSDParams[1], two, 10);
+        itoa(OSDParams[2], three, 10);
+        itoa(OSDParams[3], four, 10);
+
+        char ClearScreen[20] = " CLEAR ";
+        char RssiScreen[20] = " DRAWRSSI";
+
+        strcat(combined, OSDCommand);
+
+        if (OSDParams[0] == -99) // CLEARSCREEN    {
+            for (uint8_t i = 0; i < 20; i++)      {
+                combined[i] = ClearScreen[i];
+            }
+    }
+
+    if (OSDParams[3] == -1) // DRAW_RSSI    {
+        for (uint8_t i = 0; i < 20; i++)      {
+            combined[i] = RssiScreen[i];
+        }
+}
+
+strcat(combined, blank);
+strcat(combined, one);
+strcat(combined, blank);
+strcat(combined, two);
+strcat(combined, blank);
+strcat(combined, three);
+
+
+Serial.println(combined);
+OSDParams[3] = 0;
+
+}
 }
 
 int8_t FSButtonDirection () //gc9n
 {
-  char dir; //1 UP 2 DOWN
-  while ( Serial.available() > 0) {
-
-    dir = Serial.read();
-    if (dir == ']')
-    {
-      FS_BUTTON_DIR = 2;
-      return 2;
-    }
-
-    else if (dir == '[')
-    {
-      FS_BUTTON_DIR = 1;
-      return 1;
-    }
-
-    else
-    { FS_BUTTON_DIR = 0;
-      return 0;
-    }
-  }
-
-}
+    char dir; //1 UP 2 DOWN
+    while ( Serial.available() > 0) {
+
+        dir = Serial.read();
+        if (dir == ']')    {
+            FS_BUTTON_DIR = 2;
+            return 2;
+        }
+
+        else if (dir == '[')    {
+            FS_BUTTON_DIR = 1;
+            return 1;
+        }
+
+        else {
+            FS_BUTTON_DIR = 0;
+            return 0;
+        }
+    }
+
+}

    SendToOSD();
    int editing = -1;
    do {
      in_menu_time_out = 50;
      drawScreen.updateSetupMenu(menu_id, settings_beeps, settings_orderby_channel, call_sign, editing);
      while (--in_menu_time_out && ((digitalRead(buttonMode) == HIGH) && (digitalRead(buttonUp) == HIGH) && (digitalRead(buttonDown) == HIGH)  && FSButtonDirection() == 0)) // wait for next key press or time out
      {
        delay(100); // timeout delay
      }

      if (in_menu_time_out <= 0 ) {
        state = state_last_used;
        break; // Timed out, Don't save...
      }

      if (digitalRead(buttonMode) == LOW)       // channel UP
      {
        // do something about the users selection
        switch (menu_id) {
          case 0: // Channel Order Channel/Frequency
            settings_orderby_channel = !settings_orderby_channel;
            break;
          case 1:// Beeps enable/disable
            settings_beeps = !settings_beeps;
            break;

          case 2:// Edit Call Sign
            editing++;
            if (editing > 9) {
              editing = -1;
            }
            break;
          case 3:// Calibrate RSSI
            in_menu = 0;
            for (uint8_t loop = 0; loop < 10; loop++)
            {
#define RSSI_SETUP_BEEP 25
              beep(RSSI_SETUP_BEEP); // beep & debounce
              delay(RSSI_SETUP_BEEP); // debounce
            }
            state = STATE_RSSI_SETUP;
            break;
          case 4:
            in_menu = 0; // save & exit menu
            state = STATE_SAVE;
            break;
        }
      }
      else if (digitalRead(buttonUp) == LOW  || FS_BUTTON_DIR == 1) {
        if (editing == -1) {
          menu_id--;

        }
        else { // change current letter in place
          call_sign[editing]++;
          call_sign[editing] > '}' ? call_sign[editing] = ' ' : false; // loop to oter end
        }

      }
      else if (digitalRead(buttonDown) == LOW || FS_BUTTON_DIR == 2) {
        if (editing == -1) {
          menu_id++;


        }
        else { // change current letter in place
          call_sign[editing]--;
          call_sign[editing] < ' ' ? call_sign[editing] = '}' : false; // loop to oter end
        }
      }

      if (menu_id > 4) {
        menu_id = 0;
      }
      if (menu_id < 0) {
        menu_id = 4;
      }

      OSDParams[0] = 1; //this is main menu
      OSDParams[1] = menu_id + 1; //By defaut=lt goes over manual
      SendToOSD();
      beep(50); // beep & debounce
      do {
        delay(150);// wait for button release

      }
      while (editing == -1 && (digitalRead(buttonMode) == LOW || digitalRead(buttonUp) == LOW || digitalRead(buttonDown) == LOW || FSButtonDirection() == 1 || FSButtonDirection() == 2));
    }
    while (in_menu);
  }

  /*****************************/
  /*   General house keeping   */
  /*****************************/
  if (last_channel_index != channelIndex)        // tune channel on demand
  {
    setChannelModule(channelIndex);
    last_channel_index = channelIndex;
    // keep time of tune to make sure that RSSI is stable when required
    time_of_tune = millis();
    // give 3 beeps when tuned to give feedback of correct start
    if (first_tune)
    {
      first_tune = 0;
#define UP_BEEP 100
      beep(UP_BEEP);
      delay(UP_BEEP);
      beep(UP_BEEP);
      delay(UP_BEEP);
      beep(UP_BEEP);
    }
  }
}

/*###########################################################################*/

    } // end switch

    last_state = state;
}
/*************************************/
/*   Processing depending of state   */
/*************************************/
#ifndef TVOUT_SCREENS
if (state == STATE_SCREEN_SAVER || state == STATE_SCREEN_SAVER_LITE) {


#ifdef USE_DIVERSITY
