         // save 16 bit
         EEPROM.write(EEPROM_ADR_RSSI_MAX_L,lowByte(RSSI_MAX_VAL));
         EEPROM.write(EEPROM_ADR_RSSI_MAX_H,highByte(RSSI_MAX_VAL));
+#ifdef USE_DIVERSITY
+        // diversity
+        EEPROM.write(EEPROM_ADR_DIVERSITY,diversity_mode);
+#endif
     }
     // debug reset EEPROM
     //EEPROM.write(EEPROM_ADR_STATE,255);

            delay(100);
        }
    }
    // init overlay

    //initOverlay();

    TV.select_font(font4x6);
    // setup Genlock
    //PCintPort::attachInterrupt(vsync_in,genlock ,RISING); // attach a PinChange Interrupt to our pin on the rising edge

    //PCintPort::attachInterrupt(vsync_in,genlock ,FALLING); // attach a PinChange Interrupt to our pin on the rising edge

    //PCintPort::attachInterrupt(vsync_in,genlock ,FALLING); // attach a PinChange Interrupt to our pin on the rising edge

    // hsync
    PCintPort::attachInterrupt(vsync_in,display.vsync_handle ,FALLING); // attach a PinChange Interrupt to our pin on the rising edge


    genlock_dly=GENLOCK_DLY;

    // Setup Done - LED ON
    digitalWrite(13, HIGH);

    // use values only of EEprom is not 255 = unsaved
    uint8_t eeprom_check = EEPROM.read(EEPROM_ADR_STATE);

#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

// Channels to sent to the SPI registers
