#include <avr/eeprom.h>
#include <rom_cfg.h>

eeprom_config_t eeprom_config;

int eeprom_config_init() {
  while (!eeprom_is_ready());
  eeprom_read_block(&eeprom_config, 0, sizeof(eeprom_config_t));

  if ((eeprom_config.check_code[0] != 0x5A) ||
      (eeprom_config.check_code[1] != 0xA5)) {
    return -1;
  }
  return 0;
}

