 uint8_t scan_start=0;
 uint8_t first_tune=1;
 uint8_t force_menu_redraw=0;
-uint16_t rssi_min=0;
-uint16_t rssi_max=0;
-uint16_t rssi_setup_min=0;
-uint16_t rssi_setup_max=0;
+uint16_t rssi_min_a=0;
+uint16_t rssi_max_a=0;
+uint16_t rssi_setup_min_a=0;
+uint16_t rssi_setup_max_a=0;
+#ifdef USE_DIVERSITY
+uint16_t rssi_min_b=0;
+uint16_t rssi_max_b=0;
+uint16_t rssi_setup_min_b=0;
+uint16_t rssi_setup_max_b=0;
+#endif
 uint16_t rssi_seek_found=0;
 uint16_t rssi_setup_run=0;
 


#define EEPROM_ADR_STATE 0
#define EEPROM_ADR_TUNE 1
#define EEPROM_ADR_RSSI_MIN_L 2
#define EEPROM_ADR_RSSI_MIN_H 3
#define EEPROM_ADR_RSSI_MAX_L 4
#define EEPROM_ADR_RSSI_MAX_H 5
#ifdef USE_DIVERSITY
#define EEPROM_ADR_DIVERSITY 6
#endif
//#define DEBUG


        EEPROM.write(EEPROM_ADR_STATE,START_STATE);
        EEPROM.write(EEPROM_ADR_TUNE,CHANNEL_MIN_INDEX);
        // save 16 bit
        EEPROM.write(EEPROM_ADR_RSSI_MIN_A_L,lowByte(RSSI_MIN_VAL));
        EEPROM.write(EEPROM_ADR_RSSI_MIN_A_H,highByte(RSSI_MIN_VAL));
        // save 16 bit
        EEPROM.write(EEPROM_ADR_RSSI_MAX_A_L,lowByte(RSSI_MAX_VAL));
        EEPROM.write(EEPROM_ADR_RSSI_MAX_A_H,highByte(RSSI_MAX_VAL));
#ifdef USE_DIVERSITY
        // diversity
        EEPROM.write(EEPROM_ADR_DIVERSITY,diversity_mode);
        // save 16 bit
        EEPROM.write(EEPROM_ADR_RSSI_MIN_B_L,lowByte(RSSI_MIN_VAL));
        EEPROM.write(EEPROM_ADR_RSSI_MIN_B_H,highByte(RSSI_MIN_VAL));
        // save 16 bit
        EEPROM.write(EEPROM_ADR_RSSI_MAX_B_L,lowByte(RSSI_MAX_VAL));
        EEPROM.write(EEPROM_ADR_RSSI_MAX_B_H,highByte(RSSI_MAX_VAL));
#endif
    }
    // debug reset EEPROM
