My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

configuration_store.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #ifndef CONFIGURATION_STORE_H
  23. #define CONFIGURATION_STORE_H
  24. #include "MarlinConfig.h"
  25. class MarlinSettings {
  26. public:
  27. MarlinSettings() { }
  28. static void reset();
  29. static bool save();
  30. #if ENABLED(EEPROM_SETTINGS)
  31. static bool load();
  32. #else
  33. FORCE_INLINE
  34. static bool load() { reset(); report(); return true; }
  35. #endif
  36. #if DISABLED(DISABLE_M503)
  37. static void report(bool forReplay=false);
  38. #else
  39. FORCE_INLINE
  40. static void report(bool forReplay=false) { }
  41. #endif
  42. private:
  43. static void postprocess();
  44. #if ENABLED(EEPROM_SETTINGS)
  45. static uint16_t eeprom_checksum;
  46. static bool eeprom_read_error, eeprom_write_error;
  47. static void write_data(int &pos, const uint8_t* value, uint16_t size);
  48. static void read_data(int &pos, uint8_t* value, uint16_t size);
  49. #endif
  50. };
  51. extern MarlinSettings settings;
  52. #endif // CONFIGURATION_STORE_H