|
@@ -1496,7 +1496,9 @@ void setup()
|
|
#ifdef SNMM
|
|
#ifdef SNMM
|
|
if (eeprom_read_dword((uint32_t*)EEPROM_BOWDEN_LENGTH) == 0x0ffffffff) { //bowden length used for SNMM
|
|
if (eeprom_read_dword((uint32_t*)EEPROM_BOWDEN_LENGTH) == 0x0ffffffff) { //bowden length used for SNMM
|
|
int _z = BOWDEN_LENGTH;
|
|
int _z = BOWDEN_LENGTH;
|
|
- for(int i = 0; i<4; i++) EEPROM_save_B(EEPROM_BOWDEN_LENGTH + i * 2, &_z);
|
|
|
|
|
|
+ for(uint8_t i = 0; i < 4; i++) {
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_BOWDEN_LENGTH + i, _z);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -1541,7 +1543,9 @@ void setup()
|
|
//eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
|
|
//eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
int16_t z_shift = 0;
|
|
int16_t z_shift = 0;
|
|
- for (uint8_t i = 0; i < 5; i++) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
+ for (uint8_t i = 0; i < 5; i++) {
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift);
|
|
|
|
+ }
|
|
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
|
|
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
|
|
}
|
|
}
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
|
|
@@ -1565,8 +1569,8 @@ void setup()
|
|
#ifdef PAT9125
|
|
#ifdef PAT9125
|
|
fsensor_setup_interrupt();
|
|
fsensor_setup_interrupt();
|
|
#endif //PAT9125
|
|
#endif //PAT9125
|
|
- for (int i = 0; i<4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
|
|
|
-
|
|
|
|
|
|
+ eeprom_update_block(bowden_length, (uint16_t*)EEPROM_BOWDEN_LENGTH, sizeof(bowden_length));
|
|
|
|
+
|
|
#ifndef DEBUG_DISABLE_STARTMSGS
|
|
#ifndef DEBUG_DISABLE_STARTMSGS
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
|
|
|
@@ -2886,7 +2890,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
raise_z_above(Z_RAISE_BEFORE_HOMING);
|
|
raise_z_above(Z_RAISE_BEFORE_HOMING);
|
|
st_synchronize();
|
|
st_synchronize();
|
|
#endif // defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0)
|
|
#endif // defined (Z_RAISE_BEFORE_HOMING) && (Z_RAISE_BEFORE_HOMING > 0)
|
|
- #if (defined(MESH_BED_LEVELING) && !defined(MK1BP)) // If Mesh bed leveling, move X&Y to safe position for home
|
|
|
|
|
|
+ #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home
|
|
raise_z_above(MESH_HOME_Z_SEARCH);
|
|
raise_z_above(MESH_HOME_Z_SEARCH);
|
|
st_synchronize();
|
|
st_synchronize();
|
|
if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS);
|
|
if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS);
|
|
@@ -2994,7 +2998,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
// and correct the current_position XY axes to match the transformed coordinate system.
|
|
// and correct the current_position XY axes to match the transformed coordinate system.
|
|
world2machine_update_current();
|
|
world2machine_update_current();
|
|
|
|
|
|
-#if (defined(MESH_BED_LEVELING) && !defined(MK1BP))
|
|
|
|
|
|
+#ifdef MESH_BED_LEVELING
|
|
if (home_x_axis || home_y_axis || without_mbl || home_z_axis)
|
|
if (home_x_axis || home_y_axis || without_mbl || home_z_axis)
|
|
{
|
|
{
|
|
if (! home_z && mbl_was_active) {
|
|
if (! home_z && mbl_was_active) {
|
|
@@ -5411,7 +5415,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
{
|
|
{
|
|
float temp = (40 + i * 5);
|
|
float temp = (40 + i * 5);
|
|
printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5));
|
|
printf_P(_N("\nStep: %d/6 (skipped)\nPINDA temperature: %d Z shift (mm):0\n"), i + 2, (40 + i*5));
|
|
- if (i >= 0) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
+ if (i >= 0) {
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift);
|
|
|
|
+ }
|
|
if (start_temp <= temp) break;
|
|
if (start_temp <= temp) break;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -5450,7 +5456,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z);
|
|
printf_P(_N("\nPINDA temperature: %.1f Z shift (mm): %.3f"), current_temperature_pinda, current_position[Z_AXIS] - zero_z);
|
|
|
|
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift);
|
|
}
|
|
}
|
|
lcd_temp_cal_show_result(true);
|
|
lcd_temp_cal_show_result(true);
|
|
homing_flag = false;
|
|
homing_flag = false;
|
|
@@ -5535,7 +5541,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
printf_P(_N("\nTemperature: %d Z shift (mm): %.3f\n"), t_c, current_position[Z_AXIS] - zero_z);
|
|
printf_P(_N("\nTemperature: %d Z shift (mm): %.3f\n"), t_c, current_position[Z_AXIS] - zero_z);
|
|
|
|
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i*2, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift);
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -5591,9 +5597,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
*/
|
|
*/
|
|
|
|
|
|
case 80: {
|
|
case 80: {
|
|
-#ifdef MK1BP
|
|
|
|
- break;
|
|
|
|
-#endif //MK1BP
|
|
|
|
gcode_G80();
|
|
gcode_G80();
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -5657,7 +5660,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
}else{
|
|
}else{
|
|
// Save it to the eeprom
|
|
// Save it to the eeprom
|
|
babystepLoadZ = babystepz;
|
|
babystepLoadZ = babystepz;
|
|
- EEPROM_save_B(EEPROM_BABYSTEP_Z0+(BabyPosition*2),&babystepLoadZ);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z0 + BabyPosition, babystepLoadZ);
|
|
// adjust the Z
|
|
// adjust the Z
|
|
babystepsTodoZadd(babystepLoadZ);
|
|
babystepsTodoZadd(babystepLoadZ);
|
|
}
|
|
}
|
|
@@ -6900,8 +6903,6 @@ Sigma_Exit:
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //in the end of print set estimated time to end of print and extruders used during print to default values for next print
|
|
|
|
- print_time_remaining_init();
|
|
|
|
snmm_filaments_used = 0;
|
|
snmm_filaments_used = 0;
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -8337,7 +8338,9 @@ Sigma_Exit:
|
|
SERIAL_PROTOCOLLN("index, temp, ustep, um");
|
|
SERIAL_PROTOCOLLN("index, temp, ustep, um");
|
|
for (uint8_t i = 0; i < 6; i++)
|
|
for (uint8_t i = 0; i < 6; i++)
|
|
{
|
|
{
|
|
- if(i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i-1) * 2, &usteps);
|
|
|
|
|
|
+ if(i > 0) {
|
|
|
|
+ usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1));
|
|
|
|
+ }
|
|
float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS];
|
|
float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS];
|
|
i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1);
|
|
i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1);
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
@@ -8352,21 +8355,23 @@ Sigma_Exit:
|
|
else if (code_seen('!')) { // ! - Set factory default values
|
|
else if (code_seen('!')) { // ! - Set factory default values
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
int16_t z_shift = 8; //40C - 20um - 8usteps
|
|
int16_t z_shift = 8; //40C - 20um - 8usteps
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT, z_shift);
|
|
z_shift = 24; //45C - 60um - 24usteps
|
|
z_shift = 24; //45C - 60um - 24usteps
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + 2, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 1, z_shift);
|
|
z_shift = 48; //50C - 120um - 48usteps
|
|
z_shift = 48; //50C - 120um - 48usteps
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + 4, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 2, z_shift);
|
|
z_shift = 80; //55C - 200um - 80usteps
|
|
z_shift = 80; //55C - 200um - 80usteps
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + 6, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 3, z_shift);
|
|
z_shift = 120; //60C - 300um - 120usteps
|
|
z_shift = 120; //60C - 300um - 120usteps
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + 8, &z_shift);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + 4, z_shift);
|
|
SERIAL_PROTOCOLLN("factory restored");
|
|
SERIAL_PROTOCOLLN("factory restored");
|
|
}
|
|
}
|
|
else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation)
|
|
else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation)
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
int16_t z_shift = 0;
|
|
int16_t z_shift = 0;
|
|
- for (uint8_t i = 0; i < 5; i++) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
+ for (uint8_t i = 0; i < 5; i++) {
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift);
|
|
|
|
+ }
|
|
SERIAL_PROTOCOLLN("zerorized");
|
|
SERIAL_PROTOCOLLN("zerorized");
|
|
}
|
|
}
|
|
else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I
|
|
else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I
|
|
@@ -8374,13 +8379,15 @@ Sigma_Exit:
|
|
if (code_seen('I')) {
|
|
if (code_seen('I')) {
|
|
uint8_t index = code_value_uint8();
|
|
uint8_t index = code_value_uint8();
|
|
if (index < 5) {
|
|
if (index < 5) {
|
|
- EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + index * 2, &usteps);
|
|
|
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps);
|
|
SERIAL_PROTOCOLLN("OK");
|
|
SERIAL_PROTOCOLLN("OK");
|
|
SERIAL_PROTOCOLLN("index, temp, ustep, um");
|
|
SERIAL_PROTOCOLLN("index, temp, ustep, um");
|
|
for (uint8_t i = 0; i < 6; i++)
|
|
for (uint8_t i = 0; i < 6; i++)
|
|
{
|
|
{
|
|
usteps = 0;
|
|
usteps = 0;
|
|
- if (i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i - 1) * 2, &usteps);
|
|
|
|
|
|
+ if (i > 0) {
|
|
|
|
+ usteps = eeprom_read_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + (i - 1));
|
|
|
|
+ }
|
|
float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS];
|
|
float mm = ((float)usteps) / cs.axis_steps_per_unit[Z_AXIS];
|
|
i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1);
|
|
i == 0 ? SERIAL_PROTOCOLPGM("n/a") : SERIAL_PROTOCOL(i - 1);
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
@@ -9609,10 +9616,6 @@ void get_coordinates()
|
|
}
|
|
}
|
|
if(code_seen('F')) {
|
|
if(code_seen('F')) {
|
|
next_feedrate = code_value();
|
|
next_feedrate = code_value();
|
|
-#ifdef MAX_SILENT_FEEDRATE
|
|
|
|
- if (tmc2130_mode == TMC2130_MODE_SILENT)
|
|
|
|
- if (next_feedrate > MAX_SILENT_FEEDRATE) next_feedrate = MAX_SILENT_FEEDRATE;
|
|
|
|
-#endif //MAX_SILENT_FEEDRATE
|
|
|
|
if(next_feedrate > 0.0) feedrate = next_feedrate;
|
|
if(next_feedrate > 0.0) feedrate = next_feedrate;
|
|
if (!seen[0] && !seen[1] && !seen[2] && seen[3])
|
|
if (!seen[0] && !seen[1] && !seen[2] && seen[3])
|
|
{
|
|
{
|
|
@@ -10177,6 +10180,9 @@ void finishAndDisableSteppers()
|
|
// state for the next print.
|
|
// state for the next print.
|
|
la10c_reset();
|
|
la10c_reset();
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
|
|
+ //in the end of print set estimated time to end of print and extruders used during print to default values for next print
|
|
|
|
+ print_time_remaining_init();
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef FAST_PWM_FAN
|
|
#ifdef FAST_PWM_FAN
|
|
@@ -10880,7 +10886,7 @@ static void temp_compensation_apply() {
|
|
if (calibration_status() == CALIBRATION_STATUS_CALIBRATED) {
|
|
if (calibration_status() == CALIBRATION_STATUS_CALIBRATED) {
|
|
if (target_temperature_bed % 10 == 0 && target_temperature_bed >= 60 && target_temperature_bed <= 100) {
|
|
if (target_temperature_bed % 10 == 0 && target_temperature_bed >= 60 && target_temperature_bed <= 100) {
|
|
i_add = (target_temperature_bed - 60) / 10;
|
|
i_add = (target_temperature_bed - 60) / 10;
|
|
- EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + i_add * 2, &z_shift);
|
|
|
|
|
|
+ z_shift = eeprom_read_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i_add);
|
|
z_shift_mm = z_shift / cs.axis_steps_per_unit[Z_AXIS];
|
|
z_shift_mm = z_shift / cs.axis_steps_per_unit[Z_AXIS];
|
|
}else {
|
|
}else {
|
|
//interpolation
|
|
//interpolation
|
|
@@ -10910,7 +10916,10 @@ float temp_comp_interpolation(float inp_temperature) {
|
|
|
|
|
|
shift[0] = 0;
|
|
shift[0] = 0;
|
|
for (i = 0; i < n; i++) {
|
|
for (i = 0; i < n; i++) {
|
|
- if (i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i-1) * 2, &shift[i]); //read shift in steps from EEPROM
|
|
|
|
|
|
+ if (i > 0) {
|
|
|
|
+ //read shift in steps from EEPROM
|
|
|
|
+ shift[i] = eeprom_read_word((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + (i - 1));
|
|
|
|
+ }
|
|
temp_C[i] = 50 + i * 10; //temperature in C
|
|
temp_C[i] = 50 + i * 10; //temperature in C
|
|
#ifdef PINDA_THERMISTOR
|
|
#ifdef PINDA_THERMISTOR
|
|
constexpr int start_compensating_temp = 35;
|
|
constexpr int start_compensating_temp = 35;
|