ConfigurationStore.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef CONFIG_STORE_H
  2. #define CONFIG_STORE_H
  3. #define EEPROM_SETTINGS
  4. #include "Configuration.h"
  5. typedef struct
  6. {
  7. char version[4];
  8. float axis_steps_per_unit[4];
  9. float max_feedrate_normal[4];
  10. unsigned long max_acceleration_units_per_sq_second_normal[4];
  11. float acceleration; //!< Normal acceleration mm/s^2 THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
  12. float retract_acceleration; //!< mm/s^2 filament pull-pack and push-forward while standing still in the other axis M204 TXXXX
  13. float minimumfeedrate;
  14. float mintravelfeedrate;
  15. unsigned long minsegmenttime;
  16. float max_jerk[4]; //!< Jerk is a maximum immediate velocity change.
  17. float add_homing[3];
  18. float zprobe_zoffset;
  19. float Kp;
  20. float Ki;
  21. float Kd;
  22. float bedKp;
  23. float bedKi;
  24. float bedKd;
  25. int lcd_contrast; //!< unused
  26. bool autoretract_enabled;
  27. float retract_length;
  28. float retract_feedrate;
  29. float retract_zlift;
  30. float retract_recover_length;
  31. float retract_recover_feedrate;
  32. bool volumetric_enabled;
  33. float filament_size[1];
  34. float max_feedrate_silent[4];
  35. unsigned long max_acceleration_units_per_sq_second_silent[4];
  36. } __attribute__ ((packed)) M500_conf;
  37. extern M500_conf cs;
  38. void Config_ResetDefault();
  39. #ifndef DISABLE_M503
  40. void Config_PrintSettings(uint8_t level = 0);
  41. #else
  42. FORCE_INLINE void Config_PrintSettings() {}
  43. #endif
  44. #ifdef EEPROM_SETTINGS
  45. void Config_StoreSettings(uint16_t offset);
  46. bool Config_RetrieveSettings(uint16_t offset);
  47. #else
  48. FORCE_INLINE void Config_StoreSettings() {}
  49. FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
  50. #endif
  51. inline uint8_t calibration_status() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS); }
  52. inline void calibration_status_store(uint8_t status) { eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS, status); }
  53. inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); }
  54. #endif//CONFIG_STORE_H