ConfigurationStore.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. unsigned char axis_ustep_resolution[4];
  39. float travel_acceleration; //!< travel acceleration mm/s^2
  40. } M500_conf;
  41. extern M500_conf cs;
  42. void Config_ResetDefault();
  43. #ifndef DISABLE_M503
  44. void Config_PrintSettings(uint8_t level = 0);
  45. #else
  46. FORCE_INLINE void Config_PrintSettings() {}
  47. #endif
  48. #ifdef EEPROM_SETTINGS
  49. void Config_StoreSettings();
  50. bool Config_RetrieveSettings();
  51. #else
  52. FORCE_INLINE void Config_StoreSettings() {}
  53. FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
  54. #endif
  55. inline uint8_t calibration_status() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS); }
  56. inline void calibration_status_store(uint8_t status) { eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS, status); }
  57. inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); }
  58. #endif//CONFIG_STORE_H