Implement CNC_COORDINATE_SYSTEMS
This commit is contained in:
@@ -36,13 +36,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define EEPROM_VERSION "V43"
|
||||
#define EEPROM_VERSION "V44"
|
||||
|
||||
// Change EEPROM version if these are changed:
|
||||
#define EEPROM_OFFSET 100
|
||||
|
||||
/**
|
||||
* V43 EEPROM Layout:
|
||||
* V44 EEPROM Layout:
|
||||
*
|
||||
* 100 Version (char x4)
|
||||
* 104 EEPROM CRC16 (uint16_t)
|
||||
@@ -162,8 +162,11 @@
|
||||
* 588 M907 Z Stepper Z current (uint32_t)
|
||||
* 592 M907 E Stepper E current (uint32_t)
|
||||
*
|
||||
* 596 Minimum end-point
|
||||
* 1917 (596 + 36 + 9 + 288 + 988) Maximum end-point
|
||||
* CNC_COORDINATE_SYSTEMS 108 bytes
|
||||
* 596 G54-G59.3 coordinate_system (float x 27)
|
||||
*
|
||||
* 704 Minimum end-point
|
||||
* 2025 (704 + 36 + 9 + 288 + 988) Maximum end-point
|
||||
*
|
||||
* ========================================================================
|
||||
* meshes_begin (between max and min end-point, directly above)
|
||||
@@ -207,6 +210,10 @@ MarlinSettings settings;
|
||||
float new_z_fade_height;
|
||||
#endif
|
||||
|
||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
bool position_changed;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Post-process after Retrieve or Reset
|
||||
*/
|
||||
@@ -255,6 +262,13 @@ void MarlinSettings::postprocess() {
|
||||
#if ENABLED(FWRETRACT)
|
||||
fwretract.refresh_autoretract();
|
||||
#endif
|
||||
|
||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
if (position_changed) {
|
||||
report_current_position();
|
||||
position_changed = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLED(EEPROM_SETTINGS)
|
||||
@@ -630,6 +644,13 @@ void MarlinSettings::postprocess() {
|
||||
for (uint8_t q = 3; q--;) EEPROM_WRITE(dummyui32);
|
||||
#endif
|
||||
|
||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
EEPROM_WRITE(coordinate_system); // 27 floats
|
||||
#else
|
||||
dummy = 0.0f;
|
||||
for (uint8_t q = 27; q--;) EEPROM_WRITE(dummy);
|
||||
#endif
|
||||
|
||||
if (!eeprom_error) {
|
||||
#if ENABLED(EEPROM_CHITCHAT)
|
||||
const int eeprom_size = eeprom_index;
|
||||
@@ -1064,6 +1085,17 @@ void MarlinSettings::postprocess() {
|
||||
for (uint8_t q = 3; q--;) EEPROM_READ(dummyui32);
|
||||
#endif
|
||||
|
||||
//
|
||||
// CNC Coordinate System
|
||||
//
|
||||
|
||||
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
||||
position_changed = gcode.select_coordinate_system(-1); // Go back to machine space
|
||||
EEPROM_READ(gcode.coordinate_system); // 27 floats
|
||||
#else
|
||||
for (uint8_t q = 27; q--;) EEPROM_READ(dummy);
|
||||
#endif
|
||||
|
||||
if (working_crc == stored_crc) {
|
||||
postprocess();
|
||||
#if ENABLED(EEPROM_CHITCHAT)
|
||||
|
Reference in New Issue
Block a user