/* (c) 2017 night_ghost@ykoctpa.ru EEPROM emulation for OSD needs. Uses 1 16K page of flash to provide 2K of eeprom so it does wear leveling of 8, excluding the case when we should write 0xff value, but OSD never writes it in time of page erase all data buffered in RAM so will be lost in case of unexpected power off, but there is no in-flight writes */ #include "osd_eeprom.h" #include extern const AP_HAL::HAL& hal; #include #include #include #include #include uint32_t OSD_EEPROM::ee_ptr=0; static uint8_t data[EEPROM_SIZE] IN_CCM; // buffer for all data to be cached void OSD_EEPROM::init(){ for(uint16_t i=0;i