|
@@ -371,7 +371,15 @@ float extruder_multiplier[EXTRUDERS] = {1.0
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
};
|
|
};
|
|
|
|
+
|
|
float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
|
|
float current_position[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0 };
|
|
|
|
+//shortcuts for more readable code
|
|
|
|
+#define _x current_position[X_AXIS]
|
|
|
|
+#define _y current_position[Y_AXIS]
|
|
|
|
+#define _z current_position[Z_AXIS]
|
|
|
|
+#define _e current_position[E_AXIS]
|
|
|
|
+
|
|
|
|
+
|
|
float add_homing[3]={0,0,0};
|
|
float add_homing[3]={0,0,0};
|
|
|
|
|
|
float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
|
|
float min_pos[3] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS };
|
|
@@ -440,6 +448,7 @@ bool cancel_heatup = false ;
|
|
#define KEEPALIVE_STATE(n);
|
|
#define KEEPALIVE_STATE(n);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+
|
|
const char errormagic[] PROGMEM = "Error:";
|
|
const char errormagic[] PROGMEM = "Error:";
|
|
const char echomagic[] PROGMEM = "echo:";
|
|
const char echomagic[] PROGMEM = "echo:";
|
|
|
|
|
|
@@ -635,7 +644,6 @@ extern int8_t CrashDetectMenu;
|
|
|
|
|
|
void crashdet_enable()
|
|
void crashdet_enable()
|
|
{
|
|
{
|
|
-// MYSERIAL.println("crashdet_enable");
|
|
|
|
tmc2130_sg_stop_on_crash = true;
|
|
tmc2130_sg_stop_on_crash = true;
|
|
eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0xFF);
|
|
eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0xFF);
|
|
CrashDetectMenu = 1;
|
|
CrashDetectMenu = 1;
|
|
@@ -644,7 +652,6 @@ void crashdet_enable()
|
|
|
|
|
|
void crashdet_disable()
|
|
void crashdet_disable()
|
|
{
|
|
{
|
|
-// MYSERIAL.println("crashdet_disable");
|
|
|
|
tmc2130_sg_stop_on_crash = false;
|
|
tmc2130_sg_stop_on_crash = false;
|
|
tmc2130_sg_crash = 0;
|
|
tmc2130_sg_crash = 0;
|
|
eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0x00);
|
|
eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0x00);
|
|
@@ -896,14 +903,18 @@ int uart_putchar(char c, FILE *stream)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
void lcd_splash()
|
|
void lcd_splash()
|
|
{
|
|
{
|
|
// lcd_print_at_PGM(0, 1, PSTR(" Original Prusa "));
|
|
// lcd_print_at_PGM(0, 1, PSTR(" Original Prusa "));
|
|
// lcd_print_at_PGM(0, 2, PSTR(" 3D Printers "));
|
|
// lcd_print_at_PGM(0, 2, PSTR(" 3D Printers "));
|
|
// lcd.print_P(PSTR("\x1b[1;3HOriginal Prusa\x1b[2;4H3D Printers"));
|
|
// lcd.print_P(PSTR("\x1b[1;3HOriginal Prusa\x1b[2;4H3D Printers"));
|
|
- fputs_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"), lcdout);
|
|
|
|
|
|
+// fputs_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"), lcdout);
|
|
|
|
+ lcd_puts_P(PSTR(ESC_2J ESC_H(1,1) "Original Prusa i3" ESC_H(3,2) "Prusa Research"));
|
|
|
|
+// lcd_printf_P(_N(ESC_2J "x:%.3f\ny:%.3f\nz:%.3f\ne:%.3f"), _x, _y, _z, _e);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
void factory_reset()
|
|
void factory_reset()
|
|
{
|
|
{
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
@@ -1162,6 +1173,7 @@ void setup()
|
|
SERIAL_ECHO_START;
|
|
SERIAL_ECHO_START;
|
|
printf_P(PSTR(" " FW_VERSION_FULL "\n"));
|
|
printf_P(PSTR(" " FW_VERSION_FULL "\n"));
|
|
|
|
|
|
|
|
+
|
|
#ifdef DEBUG_SEC_LANG
|
|
#ifdef DEBUG_SEC_LANG
|
|
lang_table_header_t header;
|
|
lang_table_header_t header;
|
|
uint32_t src_addr = 0x00000;
|
|
uint32_t src_addr = 0x00000;
|
|
@@ -1333,12 +1345,12 @@ void setup()
|
|
if (crashdet && !farm_mode)
|
|
if (crashdet && !farm_mode)
|
|
{
|
|
{
|
|
crashdet_enable();
|
|
crashdet_enable();
|
|
- MYSERIAL.println("CrashDetect ENABLED!");
|
|
|
|
|
|
+ puts_P(_N("CrashDetect ENABLED!"));
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
crashdet_disable();
|
|
crashdet_disable();
|
|
- MYSERIAL.println("CrashDetect DISABLED");
|
|
|
|
|
|
+ puts_P(_N("CrashDetect DISABLED"));
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef TMC2130_LINEARITY_CORRECTION
|
|
#ifdef TMC2130_LINEARITY_CORRECTION
|
|
@@ -1406,7 +1418,6 @@ void setup()
|
|
#ifdef TMC2130
|
|
#ifdef TMC2130
|
|
|
|
|
|
if (1) {
|
|
if (1) {
|
|
-/// SERIAL_ECHOPGM("initial zsteps on power up: "); MYSERIAL.println(tmc2130_rd_MSCNT(Z_AXIS));
|
|
|
|
// try to run to zero phase before powering the Z motor.
|
|
// try to run to zero phase before powering the Z motor.
|
|
// Move in negative direction
|
|
// Move in negative direction
|
|
WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
|
WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
|
@@ -1418,7 +1429,6 @@ void setup()
|
|
WRITE(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
|
WRITE(Z_STEP_PIN, INVERT_Z_STEP_PIN);
|
|
delay(2);
|
|
delay(2);
|
|
}
|
|
}
|
|
-// SERIAL_ECHOPGM("initial zsteps after reset: "); MYSERIAL.println(tmc2130_rd_MSCNT(Z_AXIS));
|
|
|
|
}
|
|
}
|
|
#endif //TMC2130
|
|
#endif //TMC2130
|
|
|
|
|
|
@@ -1688,21 +1698,17 @@ void setup()
|
|
*/
|
|
*/
|
|
manage_heater(); // Update temperatures
|
|
manage_heater(); // Update temperatures
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
- MYSERIAL.println("Power panic detected!");
|
|
|
|
- MYSERIAL.print("Current bed temp:");
|
|
|
|
- MYSERIAL.println(degBed());
|
|
|
|
- MYSERIAL.print("Saved bed temp:");
|
|
|
|
- MYSERIAL.println((float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED));
|
|
|
|
|
|
+ printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED))
|
|
#endif
|
|
#endif
|
|
if ( degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET) ){
|
|
if ( degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET) ){
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
- MYSERIAL.println("Automatic recovery!");
|
|
|
|
|
|
+ puts_P(_N("Automatic recovery!"));
|
|
#endif
|
|
#endif
|
|
recover_print(1);
|
|
recover_print(1);
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
#ifdef DEBUG_UVLO_AUTOMATIC_RECOVER
|
|
- MYSERIAL.println("Normal recovery!");
|
|
|
|
|
|
+ puts_P(_N("Normal recovery!"));
|
|
#endif
|
|
#endif
|
|
if ( lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false) ) recover_print(0);
|
|
if ( lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false) ) recover_print(0);
|
|
else {
|
|
else {
|
|
@@ -1726,7 +1732,7 @@ void setup()
|
|
#ifdef PAT9125
|
|
#ifdef PAT9125
|
|
void fsensor_init() {
|
|
void fsensor_init() {
|
|
int pat9125 = pat9125_init();
|
|
int pat9125 = pat9125_init();
|
|
- printf_P(PSTR("PAT9125_init:%d\n"), pat9125);
|
|
|
|
|
|
+ printf_P(_N("PAT9125_init:%d\n"), pat9125);
|
|
uint8_t fsensor = eeprom_read_byte((uint8_t*)EEPROM_FSENSOR);
|
|
uint8_t fsensor = eeprom_read_byte((uint8_t*)EEPROM_FSENSOR);
|
|
filament_autoload_enabled=eeprom_read_byte((uint8_t*)EEPROM_FSENS_AUTOLOAD_ENABLED);
|
|
filament_autoload_enabled=eeprom_read_byte((uint8_t*)EEPROM_FSENS_AUTOLOAD_ENABLED);
|
|
if (!pat9125)
|
|
if (!pat9125)
|
|
@@ -3110,7 +3116,8 @@ static void gcode_PRUSA_SN()
|
|
{
|
|
{
|
|
if (farm_mode) {
|
|
if (farm_mode) {
|
|
selectedSerialPort = 0;
|
|
selectedSerialPort = 0;
|
|
- MSerial.write(";S");
|
|
|
|
|
|
+ putchar(';');
|
|
|
|
+ putchar('S');
|
|
int numbersRead = 0;
|
|
int numbersRead = 0;
|
|
ShortTimer timeout;
|
|
ShortTimer timeout;
|
|
timeout.start();
|
|
timeout.start();
|
|
@@ -3119,14 +3126,14 @@ static void gcode_PRUSA_SN()
|
|
while (MSerial.available() > 0) {
|
|
while (MSerial.available() > 0) {
|
|
uint8_t serial_char = MSerial.read();
|
|
uint8_t serial_char = MSerial.read();
|
|
selectedSerialPort = 1;
|
|
selectedSerialPort = 1;
|
|
- MSerial.write(serial_char);
|
|
|
|
|
|
+ putchar(serial_char);
|
|
numbersRead++;
|
|
numbersRead++;
|
|
selectedSerialPort = 0;
|
|
selectedSerialPort = 0;
|
|
}
|
|
}
|
|
if (timeout.expired(100u)) break;
|
|
if (timeout.expired(100u)) break;
|
|
}
|
|
}
|
|
selectedSerialPort = 1;
|
|
selectedSerialPort = 1;
|
|
- MSerial.write('\n');
|
|
|
|
|
|
+ putchar('\n');
|
|
#if 0
|
|
#if 0
|
|
for (int b = 0; b < 3; b++) {
|
|
for (int b = 0; b < 3; b++) {
|
|
tone(BEEPER, 110);
|
|
tone(BEEPER, 110);
|
|
@@ -3136,7 +3143,7 @@ static void gcode_PRUSA_SN()
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
} else {
|
|
} else {
|
|
- MYSERIAL.println("Not in farm mode.");
|
|
|
|
|
|
+ puts_P(_N("Not in farm mode."));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3217,22 +3224,16 @@ void process_commands()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (code_seen("PRN")) {
|
|
else if (code_seen("PRN")) {
|
|
- MYSERIAL.println(status_number);
|
|
|
|
|
|
+ printf_P(_N("%d"), status_number);
|
|
|
|
|
|
}else if (code_seen("FAN")) {
|
|
}else if (code_seen("FAN")) {
|
|
- MYSERIAL.print("E0:");
|
|
|
|
- MYSERIAL.print(60*fan_speed[0]);
|
|
|
|
- MYSERIAL.println(" RPM");
|
|
|
|
- MYSERIAL.print("PRN0:");
|
|
|
|
- MYSERIAL.print(60*fan_speed[1]);
|
|
|
|
- MYSERIAL.println(" RPM");
|
|
|
|
-
|
|
|
|
- }else if (code_seen("fn")) {
|
|
|
|
|
|
+ printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]);
|
|
|
|
+ }else if (code_seen("fn")) {
|
|
if (farm_mode) {
|
|
if (farm_mode) {
|
|
- MYSERIAL.println(farm_no);
|
|
|
|
|
|
+ printf_P(_N("%d"), farm_no);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- MYSERIAL.println("Not in farm mode.");
|
|
|
|
|
|
+ puts_P(_N("Not in farm mode."));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -3736,14 +3737,9 @@ void process_commands()
|
|
feedrate = homing_feedrate[Z_AXIS];
|
|
feedrate = homing_feedrate[Z_AXIS];
|
|
|
|
|
|
find_bed_induction_sensor_point_z(-10.f, 3);
|
|
find_bed_induction_sensor_point_z(-10.f, 3);
|
|
- SERIAL_PROTOCOLRPGM(_T(MSG_BED));
|
|
|
|
- SERIAL_PROTOCOLPGM(" X: ");
|
|
|
|
- MYSERIAL.print(current_position[X_AXIS], 5);
|
|
|
|
- SERIAL_PROTOCOLPGM(" Y: ");
|
|
|
|
- MYSERIAL.print(current_position[Y_AXIS], 5);
|
|
|
|
- SERIAL_PROTOCOLPGM(" Z: ");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS], 5);
|
|
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
|
|
|
|
+
|
|
|
|
+ printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z);
|
|
|
|
+
|
|
clean_up_after_endstop_move();
|
|
clean_up_after_endstop_move();
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -3751,11 +3747,8 @@ void process_commands()
|
|
|
|
|
|
case 75:
|
|
case 75:
|
|
{
|
|
{
|
|
- for (int i = 40; i <= 110; i++) {
|
|
|
|
- MYSERIAL.print(i);
|
|
|
|
- MYSERIAL.print(" ");
|
|
|
|
- MYSERIAL.println(temp_comp_interpolation(i));// / axis_steps_per_unit[Z_AXIS]);
|
|
|
|
- }
|
|
|
|
|
|
+ for (int i = 40; i <= 110; i++)
|
|
|
|
+ printf_P(_N("%d %.2f"), i, temp_comp_interpolation(i));
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -3818,8 +3811,7 @@ void process_commands()
|
|
float start_temp = 5 * (int)(current_temperature_pinda / 5);
|
|
float start_temp = 5 * (int)(current_temperature_pinda / 5);
|
|
if (start_temp < 35) start_temp = 35;
|
|
if (start_temp < 35) start_temp = 35;
|
|
if (start_temp < current_temperature_pinda) start_temp += 5;
|
|
if (start_temp < current_temperature_pinda) start_temp += 5;
|
|
- SERIAL_ECHOPGM("start temperature: ");
|
|
|
|
- MYSERIAL.println(start_temp);
|
|
|
|
|
|
+ printf_P(_N("start temperature: %.1f\n"), start_temp);
|
|
|
|
|
|
// setTargetHotend(200, 0);
|
|
// setTargetHotend(200, 0);
|
|
setTargetBed(70 + (start_temp - 30));
|
|
setTargetBed(70 + (start_temp - 30));
|
|
@@ -3859,23 +3851,12 @@ void process_commands()
|
|
}
|
|
}
|
|
zero_z = current_position[Z_AXIS];
|
|
zero_z = current_position[Z_AXIS];
|
|
|
|
|
|
- //current_position[Z_AXIS]
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
- SERIAL_ECHOPGM("ZERO: ");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS]);
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
|
|
+ printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]);
|
|
|
|
|
|
int i = -1; for (; i < 5; i++)
|
|
int i = -1; for (; i < 5; i++)
|
|
{
|
|
{
|
|
float temp = (40 + i * 5);
|
|
float temp = (40 + i * 5);
|
|
- SERIAL_ECHOPGM("Step: ");
|
|
|
|
- MYSERIAL.print(i + 2);
|
|
|
|
- SERIAL_ECHOLNPGM("/6 (skipped)");
|
|
|
|
- SERIAL_ECHOPGM("PINDA temperature: ");
|
|
|
|
- MYSERIAL.print((40 + i*5));
|
|
|
|
- SERIAL_ECHOPGM(" Z shift (mm):");
|
|
|
|
- MYSERIAL.print(0);
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
|
|
+ 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_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
if (start_temp <= temp) break;
|
|
if (start_temp <= temp) break;
|
|
}
|
|
}
|
|
@@ -3883,9 +3864,7 @@ void process_commands()
|
|
for (i++; i < 5; i++)
|
|
for (i++; i < 5; i++)
|
|
{
|
|
{
|
|
float temp = (40 + i * 5);
|
|
float temp = (40 + i * 5);
|
|
- SERIAL_ECHOPGM("Step: ");
|
|
|
|
- MYSERIAL.print(i + 2);
|
|
|
|
- SERIAL_ECHOLNPGM("/6");
|
|
|
|
|
|
+ printf_P(_N("\nStep: %d/6\n"), i + 2);
|
|
custom_message_state = i + 2;
|
|
custom_message_state = i + 2;
|
|
setTargetBed(50 + 10 * (temp - 30) / 5);
|
|
setTargetBed(50 + 10 * (temp - 30) / 5);
|
|
// setTargetHotend(255, 0);
|
|
// setTargetHotend(255, 0);
|
|
@@ -3915,12 +3894,7 @@ void process_commands()
|
|
}
|
|
}
|
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]);
|
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]);
|
|
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
- SERIAL_ECHOPGM("PINDA temperature: ");
|
|
|
|
- MYSERIAL.print(current_temperature_pinda);
|
|
|
|
- SERIAL_ECHOPGM(" Z shift (mm):");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS] - zero_z);
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
|
|
+ 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_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
@@ -3944,7 +3918,7 @@ void process_commands()
|
|
enquecommand_front_P((PSTR("G28 W0")));
|
|
enquecommand_front_P((PSTR("G28 W0")));
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
|
|
|
|
|
+ puts_P(_N("PINDA probe calibration start"));
|
|
custom_message = true;
|
|
custom_message = true;
|
|
custom_message_type = 4;
|
|
custom_message_type = 4;
|
|
custom_message_state = 1;
|
|
custom_message_state = 1;
|
|
@@ -3978,16 +3952,10 @@ void process_commands()
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
zero_z = current_position[Z_AXIS];
|
|
zero_z = current_position[Z_AXIS];
|
|
|
|
|
|
- //current_position[Z_AXIS]
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
- SERIAL_ECHOPGM("ZERO: ");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS]);
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
|
|
+ printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]);
|
|
|
|
|
|
for (int i = 0; i<5; i++) {
|
|
for (int i = 0; i<5; i++) {
|
|
- SERIAL_ECHOPGM("Step: ");
|
|
|
|
- MYSERIAL.print(i+2);
|
|
|
|
- SERIAL_ECHOLNPGM("/6");
|
|
|
|
|
|
+ printf_P(_N("\nStep: %d/6\n"), i + 2);
|
|
custom_message_state = i + 2;
|
|
custom_message_state = i + 2;
|
|
t_c = 60 + i * 10;
|
|
t_c = 60 + i * 10;
|
|
|
|
|
|
@@ -4014,12 +3982,7 @@ void process_commands()
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]);
|
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*axis_steps_per_unit[Z_AXIS]);
|
|
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
- SERIAL_ECHOPGM("Temperature: ");
|
|
|
|
- MYSERIAL.print(t_c);
|
|
|
|
- SERIAL_ECHOPGM(" Z shift (mm):");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS] - zero_z);
|
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
|
|
|
+ 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_save_B(EEPROM_PROBE_TEMP_SHIFT + i*2, &z_shift);
|
|
|
|
|
|
@@ -4029,7 +3992,7 @@ void process_commands()
|
|
custom_message = false;
|
|
custom_message = false;
|
|
|
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
- SERIAL_ECHOLNPGM("Temperature calibration done. Continue with pressing the knob.");
|
|
|
|
|
|
+ puts_P(_N("Temperature calibration done."));
|
|
disable_x();
|
|
disable_x();
|
|
disable_y();
|
|
disable_y();
|
|
disable_z();
|
|
disable_z();
|
|
@@ -4087,7 +4050,7 @@ void process_commands()
|
|
|
|
|
|
}
|
|
}
|
|
fan_speed[1];
|
|
fan_speed[1];
|
|
- MYSERIAL.print(i); SERIAL_ECHOPGM(": "); MYSERIAL.println(fan_speed[1]);
|
|
|
|
|
|
+ printf_P(_N("%d: %d\n"), i, fan_speed[1]);
|
|
}
|
|
}
|
|
}break;
|
|
}break;
|
|
|
|
|
|
@@ -5143,15 +5106,11 @@ Sigma_Exit:
|
|
if(code_seen('Q')) print_percent_done_silent = code_value();
|
|
if(code_seen('Q')) print_percent_done_silent = code_value();
|
|
if(code_seen('S')) print_time_remaining_silent = code_value();
|
|
if(code_seen('S')) print_time_remaining_silent = code_value();
|
|
|
|
|
|
- SERIAL_ECHOPGM("NORMAL MODE: Percent done: ");
|
|
|
|
- MYSERIAL.print(int(print_percent_done_normal));
|
|
|
|
- SERIAL_ECHOPGM("; print time remaining in mins: ");
|
|
|
|
- MYSERIAL.println(print_time_remaining_normal);
|
|
|
|
- SERIAL_ECHOPGM("SILENT MODE: Percent done: ");
|
|
|
|
- MYSERIAL.print(int(print_percent_done_silent));
|
|
|
|
- SERIAL_ECHOPGM("; print time remaining in mins: ");
|
|
|
|
- MYSERIAL.println(print_time_remaining_silent);
|
|
|
|
-
|
|
|
|
|
|
+ {
|
|
|
|
+ const char* _msg_mode_done_remain = _N("%S MODE: Percent done: %d; print time remaining in mins: %d\n");
|
|
|
|
+ printf_P(_msg_mode_done_remain, _N("NORMAL"), int(print_percent_done_normal), print_time_remaining_normal);
|
|
|
|
+ printf_P(_msg_mode_done_remain, _N("SILENT"), int(print_percent_done_silent), print_time_remaining_silent);
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
|
|
|
|
case 104: // M104
|
|
case 104: // M104
|
|
@@ -6819,14 +6778,8 @@ Sigma_Exit:
|
|
if (code_seen('Y')) tmc2130_sg_thr[Y_AXIS] = code_value();
|
|
if (code_seen('Y')) tmc2130_sg_thr[Y_AXIS] = code_value();
|
|
if (code_seen('Z')) tmc2130_sg_thr[Z_AXIS] = code_value();
|
|
if (code_seen('Z')) tmc2130_sg_thr[Z_AXIS] = code_value();
|
|
if (code_seen('E')) tmc2130_sg_thr[E_AXIS] = code_value();
|
|
if (code_seen('E')) tmc2130_sg_thr[E_AXIS] = code_value();
|
|
- MYSERIAL.print("tmc2130_sg_thr[X]=");
|
|
|
|
- MYSERIAL.println(tmc2130_sg_thr[X_AXIS], DEC);
|
|
|
|
- MYSERIAL.print("tmc2130_sg_thr[Y]=");
|
|
|
|
- MYSERIAL.println(tmc2130_sg_thr[Y_AXIS], DEC);
|
|
|
|
- MYSERIAL.print("tmc2130_sg_thr[Z]=");
|
|
|
|
- MYSERIAL.println(tmc2130_sg_thr[Z_AXIS], DEC);
|
|
|
|
- MYSERIAL.print("tmc2130_sg_thr[E]=");
|
|
|
|
- MYSERIAL.println(tmc2130_sg_thr[E_AXIS], DEC);
|
|
|
|
|
|
+ for (uint8_t a = X_AXIS; a <= E_AXIS; a++)
|
|
|
|
+ printf_P(_N("tmc2130_sg_thr[%c]=%d\n"), "XYZE"[a], tmc2130_sg_thr[a]);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -7157,10 +7110,7 @@ void FlushSerialRequestResend()
|
|
{
|
|
{
|
|
//char cmdbuffer[bufindr][100]="Resend:";
|
|
//char cmdbuffer[bufindr][100]="Resend:";
|
|
MYSERIAL.flush();
|
|
MYSERIAL.flush();
|
|
- SERIAL_PROTOCOLRPGM(_i("Resend: "));////MSG_RESEND c=0 r=0
|
|
|
|
- SERIAL_PROTOCOLLN(gcode_LastN + 1);
|
|
|
|
- previous_millis_cmd = millis();
|
|
|
|
- SERIAL_PROTOCOLLNRPGM(_T(MSG_OK));
|
|
|
|
|
|
+ printf_P(_N("%S: %ld\n%S\n"), _i("Resend"), gcode_LastN + 1, _T(MSG_OK));
|
|
}
|
|
}
|
|
|
|
|
|
// Confirm the execution of a command, if sent from a serial line.
|
|
// Confirm the execution of a command, if sent from a serial line.
|
|
@@ -7614,8 +7564,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
|
|
|
|
|
|
void kill(const char *full_screen_message, unsigned char id)
|
|
void kill(const char *full_screen_message, unsigned char id)
|
|
{
|
|
{
|
|
- SERIAL_ECHOPGM("KILL: ");
|
|
|
|
- MYSERIAL.println(int(id));
|
|
|
|
|
|
+ printf_P(_N("KILL: %d\n"), id);
|
|
//return;
|
|
//return;
|
|
cli(); // Stop interrupts
|
|
cli(); // Stop interrupts
|
|
disable_heater();
|
|
disable_heater();
|
|
@@ -8176,9 +8125,7 @@ void temp_compensation_apply() {
|
|
//interpolation
|
|
//interpolation
|
|
z_shift_mm = temp_comp_interpolation(target_temperature_bed) / axis_steps_per_unit[Z_AXIS];
|
|
z_shift_mm = temp_comp_interpolation(target_temperature_bed) / axis_steps_per_unit[Z_AXIS];
|
|
}
|
|
}
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
|
|
- SERIAL_PROTOCOLPGM("Z shift applied:");
|
|
|
|
- MYSERIAL.print(z_shift_mm);
|
|
|
|
|
|
+ printf_P(_N("\nZ shift applied:%.3f\n"), z_shift_mm);
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] - z_shift_mm, current_position[E_AXIS], homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] - z_shift_mm, current_position[E_AXIS], homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
st_synchronize();
|
|
st_synchronize();
|
|
plan_set_z_position(current_position[Z_AXIS]);
|
|
plan_set_z_position(current_position[Z_AXIS]);
|
|
@@ -8444,8 +8391,7 @@ void uvlo_()
|
|
if(sd_print) eeprom_update_byte((uint8_t*)EEPROM_UVLO, 1);
|
|
if(sd_print) eeprom_update_byte((uint8_t*)EEPROM_UVLO, 1);
|
|
|
|
|
|
st_synchronize();
|
|
st_synchronize();
|
|
- SERIAL_ECHOPGM("stps");
|
|
|
|
- MYSERIAL.println(tmc2130_rd_MSCNT(Z_AXIS));
|
|
|
|
|
|
+ printf_P(_N("stps%d\n"), tmc2130_rd_MSCNT(Z_AXIS));
|
|
|
|
|
|
disable_z();
|
|
disable_z();
|
|
|
|
|
|
@@ -8453,8 +8399,7 @@ void uvlo_()
|
|
eeprom_update_byte((uint8_t*)EEPROM_POWER_COUNT, eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT) + 1);
|
|
eeprom_update_byte((uint8_t*)EEPROM_POWER_COUNT, eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT) + 1);
|
|
eeprom_update_word((uint16_t*)EEPROM_POWER_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) + 1);
|
|
eeprom_update_word((uint16_t*)EEPROM_POWER_COUNT_TOT, eeprom_read_word((uint16_t*)EEPROM_POWER_COUNT_TOT) + 1);
|
|
|
|
|
|
- SERIAL_ECHOLNPGM("UVLO - end");
|
|
|
|
- MYSERIAL.println(millis() - time_start);
|
|
|
|
|
|
+ printf_P(_N("UVLO - end %d\n"), millis() - time_start);
|
|
|
|
|
|
#if 0
|
|
#if 0
|
|
// Move the print head to the side of the print until all the power stored in the power supply capacitors is depleted.
|
|
// Move the print head to the side of the print until all the power stored in the power supply capacitors is depleted.
|
|
@@ -8568,19 +8513,13 @@ void recover_print(uint8_t automatic) {
|
|
/*while ((abs(degHotend(0)- target_temperature[0])>5) || (abs(degBed() -target_temperature_bed)>3)) { //wait for heater and bed to reach target temp
|
|
/*while ((abs(degHotend(0)- target_temperature[0])>5) || (abs(degBed() -target_temperature_bed)>3)) { //wait for heater and bed to reach target temp
|
|
delay_keep_alive(1000);
|
|
delay_keep_alive(1000);
|
|
}*/
|
|
}*/
|
|
- SERIAL_ECHOPGM("After waiting for temp:");
|
|
|
|
- SERIAL_ECHOPGM("Current position X_AXIS:");
|
|
|
|
- MYSERIAL.println(current_position[X_AXIS]);
|
|
|
|
- SERIAL_ECHOPGM("Current position Y_AXIS:");
|
|
|
|
- MYSERIAL.println(current_position[Y_AXIS]);
|
|
|
|
|
|
+
|
|
|
|
+ printf_P(_N("After waiting for temp:\nCurrent pos X_AXIS:%.3f\nCurrent pos Y_AXIS:%.3f\n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
|
|
|
|
|
// Restart the print.
|
|
// Restart the print.
|
|
restore_print_from_eeprom();
|
|
restore_print_from_eeprom();
|
|
|
|
|
|
- SERIAL_ECHOPGM("current_position[Z_AXIS]:");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS]);
|
|
|
|
- SERIAL_ECHOPGM("current_position[E_AXIS]:");
|
|
|
|
- MYSERIAL.print(current_position[E_AXIS]);
|
|
|
|
|
|
+ printf_P(_N("Current pos Z_AXIS:%.3f\nCurrent pos E_AXIS:%.3f\n"), current_position[Z_AXIS], current_position[E_AXIS]);
|
|
}
|
|
}
|
|
|
|
|
|
void recover_machine_state_after_power_panic()
|
|
void recover_machine_state_after_power_panic()
|
|
@@ -8942,24 +8881,12 @@ void restore_print_from_ram_and_continue(float e_move)
|
|
|
|
|
|
void print_world_coordinates()
|
|
void print_world_coordinates()
|
|
{
|
|
{
|
|
- SERIAL_ECHOPGM("world coordinates: (");
|
|
|
|
- MYSERIAL.print(current_position[X_AXIS], 3);
|
|
|
|
- SERIAL_ECHOPGM(", ");
|
|
|
|
- MYSERIAL.print(current_position[Y_AXIS], 3);
|
|
|
|
- SERIAL_ECHOPGM(", ");
|
|
|
|
- MYSERIAL.print(current_position[Z_AXIS], 3);
|
|
|
|
- SERIAL_ECHOLNPGM(")");
|
|
|
|
|
|
+ printf_P(_N("world coordinates: (%.3f, %.3f, %.3f)\n"), current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]);
|
|
}
|
|
}
|
|
|
|
|
|
void print_physical_coordinates()
|
|
void print_physical_coordinates()
|
|
{
|
|
{
|
|
- SERIAL_ECHOPGM("physical coordinates: (");
|
|
|
|
- MYSERIAL.print(st_get_position_mm(X_AXIS), 3);
|
|
|
|
- SERIAL_ECHOPGM(", ");
|
|
|
|
- MYSERIAL.print(st_get_position_mm(Y_AXIS), 3);
|
|
|
|
- SERIAL_ECHOPGM(", ");
|
|
|
|
- MYSERIAL.print(st_get_position_mm(Z_AXIS), 3);
|
|
|
|
- SERIAL_ECHOLNPGM(")");
|
|
|
|
|
|
+ printf_P(_N("physical coordinates: (%.3f, %.3f, %.3f)\n"), st_get_position_mm[X_AXIS], st_get_position_mm[Y_AXIS], st_get_position_mm[Z_AXIS]);
|
|
}
|
|
}
|
|
|
|
|
|
void print_mesh_bed_leveling_table()
|
|
void print_mesh_bed_leveling_table()
|