 
 #ifdef USE_DIVERSITY
 
-          if (isDiversity()) { // only calibrate RSSI B when diversity is detected.
+          if (isDiversity()) {                                 // only calibrate RSSI B when diversity is detected.
             rssi_min_b = rssi_setup_min_b;
             rssi_max_b = rssi_setup_max_b;
-            if (rssi_max_b < 125) { // user probably did not turn on the VTX during calibration
+            if (rssi_max_b < 125)                              // user probably did not turn on the VTX during calibration
               rssi_max_b = RSSI_MAX_VAL;
-            }
+              
             // save 16 bit
             EEPROM.write(EEPROM_ADR_RSSI_MIN_B_L, (rssi_min_b & 0xff));
             EEPROM.write(EEPROM_ADR_RSSI_MIN_B_H, (rssi_min_b >> 8));

    // changed state, clear an draw new screen

    // simple menu
    switch (state)
    {
      case STATE_SCAN: // Band Scanner
        state_last_used = state;
      case STATE_RSSI_SETUP: // RSSI setup
        // draw selected
        if (state == STATE_RSSI_SETUP)
        {
          // prepare new setup
          rssi_min_a = 50;
          rssi_max_a = 300; // set to max range
          rssi_setup_min_a = RSSI_MAX_VAL;
          rssi_setup_max_a = RSSI_MIN_VAL;
#ifdef USE_DIVERSITY
          rssi_min_b = 50;
          rssi_max_b = 300; // set to max range
          rssi_setup_min_b = RSSI_MAX_VAL;
          rssi_setup_max_b = RSSI_MIN_VAL;
#endif
          rssi_setup_run = RSSI_SETUP_RUN;
        }

        // trigger new scan from begin
        channel = CHANNEL_MIN;
        channelIndex = pgm_read_byte_near(channelList + channel);
        rssi_best = 0;
        scan_start = 1;
        drawScreen.bandScanMode(state);
        break;
      case STATE_SEEK: // seek mode
        rssi_seek_threshold = RSSI_SEEK_TRESHOLD;
        rssi_best = 0;
        force_seek = 1;
      case STATE_MANUAL: // manual mode
        if (state == STATE_MANUAL)
        {
          time_screen_saver = millis();
        }
        else if (state == STATE_SEEK)
        {
          time_screen_saver = 0; // dont show screen saver until we found a channel.
        }
        drawScreen.seekMode(state);

        // return user to their saved channel after bandscan
        if (state_last_used == STATE_SCAN || state_last_used == STATE_FAVORITE || last_state == STATE_RSSI_SETUP ) {
          channelIndex = EEPROM.read(EEPROM_ADR_TUNE);
        }
        state_last_used = state;
        break;
#ifdef USE_DIVERSITY
      case STATE_DIVERSITY:
        // diversity menu is below this is just a place holder.
        break;
#endif
      case STATE_SETUP_MENU:

        break;
      case STATE_SAVE:

        EEPROM.write(EEPROM_ADR_TUNE, channelIndex);
        EEPROM.write(EEPROM_ADR_STATE, state_last_used);
        EEPROM.write(EEPROM_ADR_BEEP, settings_beeps);
        EEPROM.write(EEPROM_ADR_ORDERBY, settings_orderby_channel);
        // save call sign
        for (uint8_t i = 0; i < sizeof(call_sign); i++) {
          EEPROM.write(EEPROM_ADR_CALLSIGN + i, call_sign[i]);
        }
#ifdef USE_DIVERSITY
        EEPROM.write(EEPROM_ADR_DIVERSITY, diversity_mode);
#endif

        ///////////////////////FAVORITIES SAVE Gc9n
        if (last_state != STATE_SETUP_MENU  && state_last_used != STATE_FAVORITE ) // if you didnt came from menu setup  save favorite
        {
          if ( EEPROM.read(EEPROM_ADR_TUNE_FAV[9]) != 255) //ALL FAVS full gc9n
          {
            int lfav;
            lfav = EEPROM.read(EEPROM_ADR_TUNE_FAV_LAST);
            if (lfav == 9)
            {
              lfav = 0;
            }
            else
            {
              lfav = lfav + 1;
            }
            EEPROM.write(EEPROM_ADR_TUNE_FAV[lfav], 255); // rotate the favs if full
            EEPROM.write(EEPROM_ADR_TUNE_FAV_LAST, lfav);
          }
          for (int i = 0; i < 10; i++)
          {
            if ( EEPROM.read(EEPROM_ADR_TUNE_FAV[i]) == 255) //not used  gc9n
            {
              EEPROM.write(EEPROM_ADR_TUNE_FAV[i], channelIndex);
              EEPROM.write(EEPROM_ADR_TUNE_FAV_LAST, i);
              i = 12; //exit loop
            }
          }
          OSDParams[0] = -2; //this is save
          OSDParams[1] = 0; //By default goes over manual
          SendToOSD(); //UPDATE OSD
          drawScreen.save(state_last_used, channelIndex, pgm_read_word_near(channelFreqTable + channelIndex), call_sign, EEPROM.read(EEPROM_ADR_TUNE_FAV_LAST) + 1);
        }
        if (last_state == STATE_SETUP_MENU)
        { OSDParams[0] = -2; //this is save
          OSDParams[1] = 0; //By default goes over manual
          SendToOSD(); //UPDATE OSD
          drawScreen.save(state_last_used, channelIndex, pgm_read_word_near(channelFreqTable + channelIndex), call_sign, -99);
        }

        ///LONG PRESS IN FAVORITES WILL DELETE THE CURRENT FAVORITE CHANNEL
        if  (state_last_used == STATE_FAVORITE && last_state == 255)
        {  
          OSDParams[0] = -3; //this is delete
          OSDParams[1] = 0; //By default goes over manual
          SendToOSD(); //UPDATE OSD
          EEPROM.write(EEPROM_ADR_TUNE_FAV[lfavs], 255);
          drawScreen.FavDelete(   pgm_read_word_near(channelFreqTable + channelIndex), lfavs + 1);
          
          for (int i = 0; i < 10; i++) {
            temp_EEPROM_ADR_TUNE_FAV[i] = 255;    //empty temp
          }

          //--REORGANIZE FAVS  GC9n
          int MaxFav = 0;
          for (int i = 0; i < 10; i++)
          {

            if ( EEPROM.read(EEPROM_ADR_TUNE_FAV[i]) != 255) //not used  gc9n
            {
              FillTemp_Tune_fav(EEPROM.read(EEPROM_ADR_TUNE_FAV[i]));
              MaxFav++;
            }
          }


          for (int i = 0; i < 10; i++)
          {
            EEPROM.write(EEPROM_ADR_TUNE_FAV[i], temp_EEPROM_ADR_TUNE_FAV[i] );

          }


          //DELETED SUCCESFULLY AND GO TO FIRST FAV (IF EXISTS)
          //drawScreen.FavReorg(MaxFav);
          RefreshFav = false;
           delay(1000);
          EEPROM.write(EEPROM_ADR_TUNE_FAV_LAST, 0);
          channelIndex = EEPROM.read(EEPROM_ADR_TUNE_FAV[0]) ;
          lfavs = 0;
          channelIndex = EEPROM.read(EEPROM_ADR_TUNE_FAV[0]) ;
          drawScreen.FavSel(1);
          channel = channel_from_index(channelIndex);
          EEPROM.write(EEPROM_ADR_TUNE, channelIndex);


          //drawScreen.screenSaver(diversity_mode, pgm_read_byte_near(channelNames + channelIndex), pgm_read_word_near(channelFreqTable + channelIndex), call_sign);
        }
        ///END LONG PRESS IN FAVORITES WILL DELETE THE CURRENT FAVORITE CHANNEL
        for (uint8_t loop = 0; loop < 5; loop++)
        {
          beep(100); // beep
          delay(100);
        }
        delay(800);
        state = state_last_used; // return to saved function
        force_menu_redraw = 1; // we change the state twice, must force redraw of menu

        // selection by inverted box
        break;

      case STATE_FAVORITE: // FAV mode
        if (state == STATE_FAVORITE)
        {
          time_screen_saver = millis();
        }
        else if (state == STATE_SEEK)
        {
          time_screen_saver = 0; // dont show screen saver until we found a channel.
        }

        //drawScreen.FavMode(state,FirstFav);

        // return user to their saved channel after bandscan
        if (state_last_used == STATE_SCAN || state_last_used == STATE_FAVORITE  || last_state == STATE_RSSI_SETUP) {
          channelIndex = EEPROM.read(EEPROM_ADR_TUNE);
        }
        state_last_used = state;
        break;

    } // 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
    drawScreen.screenSaver(diversity_mode, pgm_read_byte_near(channelNames + channelIndex), pgm_read_word_near(channelFreqTable + channelIndex), call_sign);
#else

void beep(uint16_t time)
{
  digitalWrite(led, HIGH);
  if (settings_beeps)
    digitalWrite(buzzer, LOW); // activate beep
  delay(time / 2);
  digitalWrite(led, LOW);
  digitalWrite(buzzer, HIGH);
