PINDA v2 temperature sensor / compensation (#16293)

This commit is contained in:
tompe-proj
2020-01-18 00:16:45 +01:00
committed by Scott Lahteine
parent 4108c5d01f
commit a338dce83f
16 changed files with 1016 additions and 41 deletions

View File

@@ -114,6 +114,10 @@
#include "../feature/tmc_util.h"
#endif
#if ENABLED(PROBE_TEMP_COMPENSATION)
#include "../feature/probe_temp_compensation.h"
#endif
#pragma pack(push, 1) // No padding between variables
typedef struct { uint16_t X, Y, Z, X2, Y2, Z2, Z3, E0, E1, E2, E3, E4, E5; } tmc_stepper_current_t;
@@ -212,6 +216,18 @@ typedef struct SettingsDataStruct {
//
uint16_t servo_angles[EEPROM_NUM_SERVOS][2]; // M281 P L U
//
// Temperature first layer compensation values
//
#if ENABLED(PROBE_TEMP_COMPENSATION)
int16_t z_offsets_probe[COUNT(temp_comp.z_offsets_probe)], // M871 P I V
z_offsets_bed[COUNT(temp_comp.z_offsets_bed)] // M871 B I V
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
, z_offsets_ext[COUNT(temp_comp.z_offsets_ext)] // M871 E I V
#endif
;
#endif
//
// BLTOUCH
//
@@ -699,6 +715,19 @@ void MarlinSettings::postprocess() {
EEPROM_WRITE(servo_angles);
}
//
// Thermal first layer compensation values
//
#if ENABLED(PROBE_TEMP_COMPENSATION)
EEPROM_WRITE(temp_comp.z_offsets_probe);
EEPROM_WRITE(temp_comp.z_offsets_bed);
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
EEPROM_WRITE(temp_comp.z_offsets_ext);
#endif
#else
// No placeholder data for this feature
#endif
//
// BLTOUCH
//
@@ -1514,6 +1543,20 @@ void MarlinSettings::postprocess() {
EEPROM_READ(servo_angles_arr);
}
//
// Thermal first layer compensation values
//
#if ENABLED(PROBE_TEMP_COMPENSATION)
EEPROM_READ(temp_comp.z_offsets_probe);
EEPROM_READ(temp_comp.z_offsets_bed);
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
EEPROM_READ(temp_comp.z_offsets_ext);
#endif
temp_comp.reset_index();
#else
// No placeholder data for this feature
#endif
//
// BLTOUCH
//