#include "./persist.h" #include void Persist::init() { PersistHeader header; EEPROM.get(0, header); if (header.identifier == PersistIdentifier) { if (header.version >= 1) this->readHeights(); this->initialized = true; } } void Persist::readHeights() { EEPROM.get(PersistHeightsAddress, this->heights); } void Persist::writeHeights() { EEPROM.put(PersistHeightsAddress, this->heights); } void Persist::setHeightOffset(uint8_t newValue) { if (newValue == this->heights.offset) return; this->heights.offset = newValue; this->writeHeights(); }