ConfigurationStore.h 2.1 KB

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