ConfigurationStore.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. } M500_conf;
  40. extern M500_conf cs;
  41. void Config_ResetDefault();
  42. #ifndef DISABLE_M503
  43. void Config_PrintSettings(uint8_t level = 0);
  44. #else
  45. FORCE_INLINE void Config_PrintSettings() {}
  46. #endif
  47. #ifdef EEPROM_SETTINGS
  48. void Config_StoreSettings();
  49. bool Config_RetrieveSettings();
  50. #else
  51. FORCE_INLINE void Config_StoreSettings() {}
  52. FORCE_INLINE void Config_RetrieveSettings() { Config_ResetDefault(); Config_PrintSettings(); }
  53. #endif
  54. inline uint8_t calibration_status() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS); }
  55. inline void calibration_status_store(uint8_t status) { eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS, status); }
  56. inline bool calibration_status_pinda() { return eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA); }
  57. #endif//CONFIG_STORE_H