Close



Results 1 to 10 of 757

Threaded View

  1. #10
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    As a result of that experience, I wrote a small piece of firmware to invalidate the EEPROM so the setting are not taken from it unless you actually do an implicit store to the EEPROM. I think the original authors of Marlin were trying to save a little firmware space and did not include it. But if you are making changes to your Configuration.h file, it gets annoying having to load the default settings and save them each time. Its easier to just invalidate the EEPROM (with a M499) command:

    In Marlin_Main.cpp:

    case 499: // Invalidate the M500 Store settings in EEPROM command
    {
    Invalidate_EEPROM_Settings(); // Roxy added function to guarintee we are using
    // the default values defined in the firmware!
    }
    break;

    In ConfigurationStore.cpp:

    void Invalidate_EEPROM_Settings()
    {
    char bogus_ver[4] = "xyz";
    char confirmation[4] = "???";
    int i=EEPROM_OFFSET;

    EEPROM_WRITE_VAR(i,bogus_ver);

    i=EEPROM_OFFSET;
    EEPROM_READ_VAR(i,confirmation); //read stored version

    if (strncmp(bogus_ver, confirmation,3) == 0)
    SERIAL_PROTOCOLLNPGM("EEPROM Settings invalidated.");
    else {
    SERIAL_PROTOCOLLNPGM("EEPROM Settings not invalidated.");
    SERIAL_PROTOCOLPGM("Read Version: [");
    SERIAL_PROTOCOL(confirmation);
    SERIAL_PROTOCOLLNPGM("]\n");
    }
    }

    In ConfigurationStore.h:
    #ifdef EEPROM_SETTINGS
    void Invalidate_EEPROM_Settings(); // Roxy routine to guarantee we are using default firmware values
    void Config_StoreSettings();
    void Config_RetrieveSettings();
    #else
    FORCE_INLINE void Config_StoreSettings() {}
    FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
    #endif
    Last edited by Roxy; 08-05-2014 at 08:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •