/* Function that performs simulated EEPROM clearing. 
Function fills the EEPROM with 0xFF value. It is accessing the EEPROM writing only one byte at once.  */
static void do_clear_eeprom(void)
/* Function that performs simulated EEPROM clearing. 
Function fills the EEPROM with 0xFF value. It is accessing the EEPROM writing only one byte at once.  */
static void do_clear_eeprom(void)
{
    uint8_t clear_val = 0xff;
    size_t addr;
    for (addr=0; addr<(EEPROM_SIM_SIZE); ++addr)
    {
        ret_code_t err_code;
        err_code = eeprom_write(addr, &clear_val, 1);
        if (NRF_SUCCESS != err_code)
        {
            NRF_LOG_WARNING("Communication error\r\n");
            return;
        }
    }
    NRF_LOG_RAW_INFO("Memory erased\r\n");
}