ingdemurtas:
The default settings need to be stored somewhere, either a variable in program memory or in EEPROM.
I am short on program memory, and I can save space if I put the default settings in EEPROM.
s_temp is defined in the setup(), so it is deleted after use.Does it make sense?
The default settings are already stored in program memory (or perhaps initialized dynamically when you create a settings_type object). Otherwise, you wouldn't be able to check the default values in EEPROM in the first place.
What I'm suggesting is to completely forget about saving (and checking) default values in EEPROM and instead just save the default settings directly from program memory to your EEPROM settings when you want to reset them. I gave example code (not tested) that does this in post #16.
Edit: the "static" in post #16 is not necessary. You can remove it to save some global memory. A settings_type object will be created on the stack every time you call reset_settings_to_defaults rather than take up global memory for the whole life of your program.