|
@@ -47,7 +47,9 @@
|
|
|
#include "Configuration.h"
|
|
|
#include "Marlin.h"
|
|
|
#include "config.h"
|
|
|
-
|
|
|
+
|
|
|
+#include "macros.h"
|
|
|
+
|
|
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
|
|
#include "vector_3.h"
|
|
|
#ifdef AUTO_BED_LEVELING_GRID
|
|
@@ -88,18 +90,13 @@
|
|
|
#include "la10compat.h"
|
|
|
#endif
|
|
|
|
|
|
-#ifdef SWSPI
|
|
|
-#include "swspi.h"
|
|
|
-#endif //SWSPI
|
|
|
-
|
|
|
#include "spi.h"
|
|
|
|
|
|
-#ifdef SWI2C
|
|
|
-#include "swi2c.h"
|
|
|
-#endif //SWI2C
|
|
|
-
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
#include "fsensor.h"
|
|
|
+#ifdef IR_SENSOR
|
|
|
+#include "pat9125.h" // for pat9125_probe
|
|
|
+#endif
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
|
|
|
#ifdef TMC2130
|
|
@@ -137,12 +134,6 @@
|
|
|
#include "sound.h"
|
|
|
|
|
|
#include "cmdqueue.h"
|
|
|
-#include "io_atmega2560.h"
|
|
|
-
|
|
|
-// Macros for bit masks
|
|
|
-#define BIT(b) (1<<(b))
|
|
|
-#define TEST(n,b) (((n)&BIT(b))!=0)
|
|
|
-#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
|
|
|
|
|
|
//Macro for print fan speed
|
|
|
#define FAN_PULSE_WIDTH_LIMIT ((fanSpeed > 100) ? 3 : 4) //time in ms
|
|
@@ -202,8 +193,6 @@ int bowden_length[4] = {385, 385, 385, 385};
|
|
|
bool is_usb_printing = false;
|
|
|
bool homing_flag = false;
|
|
|
|
|
|
-bool temp_cal_active = false;
|
|
|
-
|
|
|
unsigned long kicktime = _millis()+100000;
|
|
|
|
|
|
unsigned int usb_printing_counter;
|
|
@@ -239,7 +228,7 @@ bool fan_state[2];
|
|
|
int fan_edge_counter[2];
|
|
|
int fan_speed[2];
|
|
|
|
|
|
-char dir_names[3][9];
|
|
|
+char dir_names[MAX_DIR_DEPTH][9];
|
|
|
|
|
|
bool sortAlpha = false;
|
|
|
|
|
@@ -276,6 +265,7 @@ float extruder_offset[NUM_EXTRUDER_OFFSETS][EXTRUDERS] = {
|
|
|
|
|
|
uint8_t active_extruder = 0;
|
|
|
int fanSpeed=0;
|
|
|
+uint8_t newFanSpeed = 0;
|
|
|
|
|
|
#ifdef FWRETRACT
|
|
|
bool retracted[EXTRUDERS]={false
|
|
@@ -313,6 +303,7 @@ uint8_t host_keepalive_interval = HOST_KEEPALIVE_INTERVAL;
|
|
|
|
|
|
const char errormagic[] PROGMEM = "Error:";
|
|
|
const char echomagic[] PROGMEM = "echo:";
|
|
|
+const char G28W0[] PROGMEM = "G28 W0";
|
|
|
|
|
|
bool no_response = false;
|
|
|
uint8_t important_status;
|
|
@@ -330,6 +321,8 @@ uint16_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; //estimated re
|
|
|
uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT;
|
|
|
uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes
|
|
|
|
|
|
+uint32_t IP_address = 0;
|
|
|
+
|
|
|
//===========================================================================
|
|
|
//=============================Private Variables=============================
|
|
|
//===========================================================================
|
|
@@ -395,6 +388,59 @@ static int saved_fanSpeed = 0; //!< Print fan speed
|
|
|
|
|
|
static int saved_feedmultiply_mm = 100;
|
|
|
|
|
|
+class AutoReportFeatures {
|
|
|
+ union {
|
|
|
+ struct {
|
|
|
+ uint8_t temp : 1; //Temperature flag
|
|
|
+ uint8_t fans : 1; //Fans flag
|
|
|
+ uint8_t pos: 1; //Position flag
|
|
|
+ uint8_t ar4 : 1; //Unused
|
|
|
+ uint8_t ar5 : 1; //Unused
|
|
|
+ uint8_t ar6 : 1; //Unused
|
|
|
+ uint8_t ar7 : 1; //Unused
|
|
|
+ } __attribute__((packed)) bits;
|
|
|
+ uint8_t byte;
|
|
|
+ } arFunctionsActive;
|
|
|
+ uint8_t auto_report_period;
|
|
|
+public:
|
|
|
+ LongTimer auto_report_timer;
|
|
|
+ AutoReportFeatures():auto_report_period(0){
|
|
|
+#if defined(AUTO_REPORT)
|
|
|
+ arFunctionsActive.byte = 0xff;
|
|
|
+#else
|
|
|
+ arFunctionsActive.byte = 0;
|
|
|
+#endif //AUTO_REPORT
|
|
|
+ }
|
|
|
+
|
|
|
+ inline bool Temp()const { return arFunctionsActive.bits.temp != 0; }
|
|
|
+ inline void SetTemp(uint8_t v){ arFunctionsActive.bits.temp = v; }
|
|
|
+
|
|
|
+ inline bool Fans()const { return arFunctionsActive.bits.fans != 0; }
|
|
|
+ inline void SetFans(uint8_t v){ arFunctionsActive.bits.fans = v; }
|
|
|
+
|
|
|
+ inline bool Pos()const { return arFunctionsActive.bits.pos != 0; }
|
|
|
+ inline void SetPos(uint8_t v){ arFunctionsActive.bits.pos = v; }
|
|
|
+
|
|
|
+ inline void SetMask(uint8_t mask){ arFunctionsActive.byte = mask; }
|
|
|
+
|
|
|
+ /// sets the autoreporting timer's period
|
|
|
+ /// setting it to zero stops the timer
|
|
|
+ void SetPeriod(uint8_t p){
|
|
|
+ auto_report_period = p;
|
|
|
+ if (auto_report_period != 0){
|
|
|
+ auto_report_timer.start();
|
|
|
+ } else{
|
|
|
+ auto_report_timer.stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ inline void TimerStart() { auto_report_timer.start(); }
|
|
|
+ inline bool TimerRunning()const { return auto_report_timer.running(); }
|
|
|
+ inline bool TimerExpired() { return auto_report_timer.expired(auto_report_period * 1000ul); }
|
|
|
+};
|
|
|
+
|
|
|
+AutoReportFeatures autoReportFeatures;
|
|
|
+
|
|
|
//===========================================================================
|
|
|
//=============================Routines======================================
|
|
|
//===========================================================================
|
|
@@ -404,9 +450,11 @@ static bool setTargetedHotend(int code, uint8_t &extruder);
|
|
|
static void print_time_remaining_init();
|
|
|
static void wait_for_heater(long codenum, uint8_t extruder);
|
|
|
static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis);
|
|
|
+static void gcode_M105(uint8_t extruder);
|
|
|
static void temp_compensation_start();
|
|
|
static void temp_compensation_apply();
|
|
|
|
|
|
+static bool get_PRUSA_SN(char* SN);
|
|
|
|
|
|
uint16_t gcode_in_progress = 0;
|
|
|
uint16_t mcode_in_progress = 0;
|
|
@@ -631,7 +679,7 @@ void crashdet_cancel()
|
|
|
lcd_print_stop();
|
|
|
}else if(saved_printing_type == PRINTING_TYPE_USB){
|
|
|
SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); //for Octoprint: works the same as clicking "Abort" button in Octoprint GUI
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OK);
|
|
|
+ cmdqueue_reset();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -650,6 +698,12 @@ void failstats_reset_print()
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+void softReset()
|
|
|
+{
|
|
|
+ cli();
|
|
|
+ wdt_enable(WDTO_15MS);
|
|
|
+ while(1);
|
|
|
+}
|
|
|
|
|
|
|
|
|
#ifdef MESH_BED_LEVELING
|
|
@@ -708,10 +762,8 @@ static void factory_reset(char level)
|
|
|
// Force the "Follow calibration flow" message at the next boot up.
|
|
|
calibration_status_store(CALIBRATION_STATUS_Z_CALIBRATION);
|
|
|
eeprom_write_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard
|
|
|
- farm_no = 0;
|
|
|
farm_mode = false;
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_FARM_MODE, farm_mode);
|
|
|
- EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no);
|
|
|
|
|
|
eeprom_update_dword((uint32_t *)EEPROM_TOTALTIME, 0);
|
|
|
eeprom_update_dword((uint32_t *)EEPROM_FILAMENTUSED, 0);
|
|
@@ -764,6 +816,7 @@ static void factory_reset(char level)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ softReset();
|
|
|
|
|
|
|
|
|
break;
|
|
@@ -866,17 +919,15 @@ static void check_if_fw_is_on_right_printer(){
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
if((PRINTER_TYPE == PRINTER_MK3) || (PRINTER_TYPE == PRINTER_MK3S)){
|
|
|
#ifdef IR_SENSOR
|
|
|
- swi2c_init();
|
|
|
- const uint8_t pat9125_detected = swi2c_readByte_A8(PAT9125_I2C_ADDR,0x00,NULL);
|
|
|
- if (pat9125_detected){
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("MK3S firmware detected on MK3 printer"));}
|
|
|
+ if (pat9125_probe()){
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("MK3S firmware detected on MK3 printer"));}////c=20 r=3
|
|
|
#endif //IR_SENSOR
|
|
|
|
|
|
#ifdef PAT9125
|
|
|
//will return 1 only if IR can detect filament in bondtech extruder so this may fail even when we have IR sensor
|
|
|
- const uint8_t ir_detected = !(PIN_GET(IR_SENSOR_PIN));
|
|
|
+ const uint8_t ir_detected = !READ(IR_SENSOR_PIN);
|
|
|
if (ir_detected){
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("MK3 firmware detected on MK3S printer"));}
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("MK3 firmware detected on MK3S printer"));}////c=20 r=3
|
|
|
#endif //PAT9125
|
|
|
}
|
|
|
#endif //FILAMENT_SENSOR
|
|
@@ -962,10 +1013,10 @@ uint8_t lang_xflash_enum_codes(uint16_t* codes)
|
|
|
w25x20cl_rd_data(addr, (uint8_t*)&header, sizeof(lang_table_header_t));
|
|
|
if (header.magic != LANG_MAGIC)
|
|
|
{
|
|
|
- printf_P(_n("NG!\n"));
|
|
|
+ puts_P(_n("NG!"));
|
|
|
break;
|
|
|
}
|
|
|
- printf_P(_n("OK\n"));
|
|
|
+ puts_P(_n("OK"));
|
|
|
printf_P(_n(" _lt_magic = 0x%08lx %S\n"), header.magic, (header.magic==LANG_MAGIC)?_n("OK"):_n("NA"));
|
|
|
printf_P(_n(" _lt_size = 0x%04x (%d)\n"), header.size, header.size);
|
|
|
printf_P(_n(" _lt_count = 0x%04x (%d)\n"), header.count, header.count);
|
|
@@ -1005,6 +1056,8 @@ static void w25x20cl_err_msg()
|
|
|
// are initialized by the main() routine provided by the Arduino framework.
|
|
|
void setup()
|
|
|
{
|
|
|
+ timer2_init(); // enables functional millis
|
|
|
+
|
|
|
mmu_init();
|
|
|
|
|
|
ultralcd_init();
|
|
@@ -1014,11 +1067,19 @@ void setup()
|
|
|
lcd_splash();
|
|
|
Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)"
|
|
|
|
|
|
+ selectedSerialPort = eeprom_read_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE);
|
|
|
+ if (selectedSerialPort == 0xFF) selectedSerialPort = 0;
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort);
|
|
|
+ MYSERIAL.begin(BAUDRATE);
|
|
|
+ fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream
|
|
|
+ stdout = uartout;
|
|
|
+
|
|
|
#ifdef W25X20CL
|
|
|
bool w25x20cl_success = w25x20cl_init();
|
|
|
+ uint8_t optiboot_status = 1;
|
|
|
if (w25x20cl_success)
|
|
|
{
|
|
|
- optiboot_w25x20cl_enter();
|
|
|
+ optiboot_status = optiboot_w25x20cl_enter();
|
|
|
#if (LANG_MODE != 0) //secondary language support
|
|
|
update_sec_lang_from_external_flash();
|
|
|
#endif //(LANG_MODE != 0)
|
|
@@ -1036,19 +1097,17 @@ void setup()
|
|
|
setup_powerhold();
|
|
|
|
|
|
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
|
|
|
- EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no);
|
|
|
- if ((farm_mode == 0xFF && farm_no == 0) || ((uint16_t)farm_no == 0xFFFF))
|
|
|
+ if (farm_mode == 0xFF)
|
|
|
farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
|
|
|
- if ((uint16_t)farm_no == 0xFFFF) farm_no = 0;
|
|
|
-
|
|
|
- selectedSerialPort = eeprom_read_byte((uint8_t*)EEPROM_SECOND_SERIAL_ACTIVE);
|
|
|
- if (selectedSerialPort == 0xFF) selectedSerialPort = 0;
|
|
|
if (farm_mode)
|
|
|
{
|
|
|
no_response = true; //we need confirmation by recieving PRUSA thx
|
|
|
important_status = 8;
|
|
|
prusa_statistics(8);
|
|
|
+#ifdef HAS_SECOND_SERIAL_PORT
|
|
|
selectedSerialPort = 1;
|
|
|
+#endif //HAS_SECOND_SERIAL_PORT
|
|
|
+ MYSERIAL.begin(BAUDRATE);
|
|
|
#ifdef TMC2130
|
|
|
//increased extruder current (PFW363)
|
|
|
tmc2130_current_h[E_AXIS] = 36;
|
|
@@ -1062,14 +1121,30 @@ void setup()
|
|
|
if(!(eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED)))
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED,true);
|
|
|
}
|
|
|
- MYSERIAL.begin(BAUDRATE);
|
|
|
- fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream
|
|
|
+
|
|
|
+ //saved EEPROM SN is not valid. Try to retrieve it.
|
|
|
+ //SN is valid only if it is NULL terminated. Any other character means either uninitialized or corrupted
|
|
|
+ if (eeprom_read_byte((uint8_t*)EEPROM_PRUSA_SN + 19))
|
|
|
+ {
|
|
|
+ char SN[20];
|
|
|
+ if (get_PRUSA_SN(SN))
|
|
|
+ {
|
|
|
+ eeprom_update_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20);
|
|
|
+ puts_P(PSTR("SN updated"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ puts_P(PSTR("SN update failed"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
#ifndef W25X20CL
|
|
|
SERIAL_PROTOCOLLNPGM("start");
|
|
|
-#endif //W25X20CL
|
|
|
- stdout = uartout;
|
|
|
+#else
|
|
|
+ if ((optiboot_status != 0) || (selectedSerialPort != 0))
|
|
|
+ SERIAL_PROTOCOLLNPGM("start");
|
|
|
+#endif
|
|
|
SERIAL_ECHO_START;
|
|
|
- printf_P(PSTR(" " FW_VERSION_FULL "\n"));
|
|
|
+ puts_P(PSTR(" " FW_VERSION_FULL));
|
|
|
|
|
|
//SERIAL_ECHOPAIR("Active sheet before:", static_cast<unsigned long int>(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))));
|
|
|
|
|
@@ -1159,12 +1234,12 @@ void setup()
|
|
|
printf_P(_n("_SEC_LANG_TABLE checksum = %04x\n"), sum);
|
|
|
sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes
|
|
|
if (sum == header.checksum)
|
|
|
- printf_P(_n("Checksum OK\n"), sum);
|
|
|
+ puts_P(_n("Checksum OK"), sum);
|
|
|
else
|
|
|
- printf_P(_n("Checksum NG\n"), sum);
|
|
|
+ puts_P(_n("Checksum NG"), sum);
|
|
|
}
|
|
|
else
|
|
|
- printf_P(_n("lang_get_header failed!\n"));
|
|
|
+ puts_P(_n("lang_get_header failed!"));
|
|
|
|
|
|
#if 0
|
|
|
for (uint16_t i = 0; i < 1024*10; i++)
|
|
@@ -1244,8 +1319,15 @@ void setup()
|
|
|
else
|
|
|
{
|
|
|
w25x20cl_err_msg();
|
|
|
- printf_P(_n("W25X20CL not responding.\n"));
|
|
|
+ puts_P(_n("W25X20CL not responding."));
|
|
|
}
|
|
|
+#ifdef EXTRUDER_ALTFAN_DETECT
|
|
|
+ SERIAL_ECHORPGM(_n("Extruder fan type: "));
|
|
|
+ if (extruder_altfan_detect())
|
|
|
+ SERIAL_ECHOLNRPGM(PSTR("ALTFAN"));
|
|
|
+ else
|
|
|
+ SERIAL_ECHOLNRPGM(PSTR("NOCTUA"));
|
|
|
+#endif //EXTRUDER_ALTFAN_DETECT
|
|
|
|
|
|
plan_init(); // Initialize planner;
|
|
|
|
|
@@ -1332,8 +1414,7 @@ void setup()
|
|
|
// Initialize current_position accounting for software endstops to
|
|
|
// avoid unexpected initial shifts on the first move
|
|
|
clamp_to_software_endstops(current_position);
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
|
|
- current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
fsensor_init();
|
|
@@ -1351,9 +1432,7 @@ void setup()
|
|
|
#endif
|
|
|
|
|
|
farm_mode = eeprom_read_byte((uint8_t*)EEPROM_FARM_MODE);
|
|
|
- EEPROM_read_B(EEPROM_FARM_NUMBER, &farm_no);
|
|
|
- if ((farm_mode == 0xFF && farm_no == 0) || (farm_no == static_cast<int>(0xFFFF))) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
|
|
|
- if (farm_no == static_cast<int>(0xFFFF)) farm_no = 0;
|
|
|
+ if (farm_mode == 0xFF) farm_mode = false; //if farm_mode has not been stored to eeprom yet and farm number is set to zero or EEPROM is fresh, deactivate farm mode
|
|
|
if (farm_mode)
|
|
|
{
|
|
|
prusa_statistics(8);
|
|
@@ -1453,8 +1532,7 @@ void setup()
|
|
|
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE) == 255) {
|
|
|
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
|
|
|
- temp_cal_active = false;
|
|
|
- } else temp_cal_active = eeprom_read_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE);
|
|
|
+ }
|
|
|
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) {
|
|
|
//eeprom_write_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
|
|
@@ -1462,7 +1540,6 @@ void setup()
|
|
|
int16_t z_shift = 0;
|
|
|
for (uint8_t i = 0; i < 5; i++) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
eeprom_write_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0);
|
|
|
- temp_cal_active = false;
|
|
|
}
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == 255) {
|
|
|
eeprom_write_byte((uint8_t*)EEPROM_UVLO, 0);
|
|
@@ -1515,7 +1592,7 @@ void setup()
|
|
|
}
|
|
|
|
|
|
if (!previous_settings_retrieved) {
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=4
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=5
|
|
|
Config_StoreSettings();
|
|
|
}
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) == 1) {
|
|
@@ -1535,7 +1612,7 @@ void setup()
|
|
|
lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET));
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
|
- else if (calibration_status() == CALIBRATION_STATUS_CALIBRATED && temp_cal_active == true && calibration_status_pinda() == false) {
|
|
|
+ else if (calibration_status() == CALIBRATION_STATUS_CALIBRATED && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == false) {
|
|
|
//lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration has not been run yet"));////MSG_PINDA_NOT_CALIBRATED c=20 r=4
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
@@ -1712,6 +1789,28 @@ void host_keepalive() {
|
|
|
#endif //HOST_KEEPALIVE_FEATURE
|
|
|
if (farm_mode) return;
|
|
|
long ms = _millis();
|
|
|
+
|
|
|
+#if defined(AUTO_REPORT)
|
|
|
+ {
|
|
|
+ if (autoReportFeatures.TimerExpired())
|
|
|
+ {
|
|
|
+ if(autoReportFeatures.Temp()){
|
|
|
+ gcode_M105(active_extruder);
|
|
|
+ }
|
|
|
+ if(autoReportFeatures.Pos()){
|
|
|
+ gcode_M114();
|
|
|
+ }
|
|
|
+ #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+ if(autoReportFeatures.Fans()){
|
|
|
+ gcode_M123();
|
|
|
+ }
|
|
|
+#endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1)
|
|
|
+ autoReportFeatures.TimerStart();
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif //AUTO_REPORT
|
|
|
+
|
|
|
+
|
|
|
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
|
|
if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return;
|
|
|
switch (busy_state) {
|
|
@@ -1948,7 +2047,7 @@ static void set_bed_level_equation_lsq(double *plane_equation_coefficients)
|
|
|
// put the bed at 0 so we don't go below it.
|
|
|
current_position[Z_AXIS] = cs.zprobe_zoffset; // in the lsq we reach here after raising the extruder due to the loop structure
|
|
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
}
|
|
|
|
|
|
#else // not AUTO_BED_LEVELING_GRID
|
|
@@ -1976,7 +2075,7 @@ static void set_bed_level_equation_3pts(float z_at_pt_1, float z_at_pt_2, float
|
|
|
// put the bed at 0 so we don't go below it.
|
|
|
current_position[Z_AXIS] = cs.zprobe_zoffset;
|
|
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2008,7 +2107,7 @@ static void run_z_probe() {
|
|
|
|
|
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
|
|
// make sure the planner knows where we are as it may be a bit different than we last said to move to
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
}
|
|
|
|
|
|
static void do_blocking_move_to(float x, float y, float z) {
|
|
@@ -2066,15 +2165,16 @@ static float probe_pt(float x, float y, float z_before) {
|
|
|
inline void gcode_M900() {
|
|
|
float newK = code_seen('K') ? code_value_float() : -2;
|
|
|
#ifdef LA_NOCOMPAT
|
|
|
- if (newK >= 0 && newK < 10)
|
|
|
+ if (newK >= 0 && newK < LA_K_MAX)
|
|
|
extruder_advance_K = newK;
|
|
|
else
|
|
|
SERIAL_ECHOLNPGM("K out of allowed range!");
|
|
|
#else
|
|
|
if (newK == 0)
|
|
|
+ {
|
|
|
extruder_advance_K = 0;
|
|
|
- else if (newK == -1)
|
|
|
la10c_reset();
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
newK = la10c_value(newK);
|
|
@@ -2096,7 +2196,7 @@ bool check_commands() {
|
|
|
|
|
|
while (buflen)
|
|
|
{
|
|
|
- if ((code_seen("M84")) || (code_seen("M 84"))) end_command_found = true;
|
|
|
+ if ((code_seen_P(PSTR("M84"))) || (code_seen_P(PSTR("M 84")))) end_command_found = true;
|
|
|
if (!cmdbuffer_front_already_processed)
|
|
|
cmdqueue_pop_front();
|
|
|
cmdbuffer_front_already_processed = false;
|
|
@@ -2128,7 +2228,7 @@ void raise_z_above(float target, bool plan)
|
|
|
if (axis_known_position[Z_AXIS] || z_min_endstop)
|
|
|
{
|
|
|
// current position is known or very low, it's safe to raise Z
|
|
|
- if(plan) plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS], active_extruder);
|
|
|
+ if(plan) plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2141,15 +2241,14 @@ void raise_z_above(float target, bool plan)
|
|
|
#ifdef TMC2130
|
|
|
tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
#endif //TMC2130
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
if (endstop_z_hit_on_purpose())
|
|
|
{
|
|
|
// not necessarily exact, but will avoid further vertical moves
|
|
|
current_position[Z_AXIS] = max_pos[Z_AXIS];
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
|
|
- current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
}
|
|
|
tmc2130_home_exit();
|
|
|
#endif //TMC2130
|
|
@@ -2167,22 +2266,22 @@ bool calibrate_z_auto()
|
|
|
int axis_up_dir = -home_dir(Z_AXIS);
|
|
|
tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
current_position[Z_AXIS] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
set_destination_to_current();
|
|
|
destination[Z_AXIS] += (1.1 * max_length(Z_AXIS) * axis_up_dir);
|
|
|
feedrate = homing_feedrate[Z_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate / 60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate / 60);
|
|
|
st_synchronize();
|
|
|
// current_position[axis] = 0;
|
|
|
- // plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ // plan_set_position_curposXYZE();
|
|
|
tmc2130_home_exit();
|
|
|
enable_endstops(false);
|
|
|
current_position[Z_AXIS] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
set_destination_to_current();
|
|
|
destination[Z_AXIS] += 10 * axis_up_dir; //10mm up
|
|
|
feedrate = homing_feedrate[Z_AXIS] / 2;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate / 60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate / 60);
|
|
|
st_synchronize();
|
|
|
enable_endstops(endstops_enabled);
|
|
|
if (PRINTER_TYPE == PRINTER_MK3) {
|
|
@@ -2191,15 +2290,30 @@ bool calibrate_z_auto()
|
|
|
else {
|
|
|
current_position[Z_AXIS] = Z_MAX_POS + 9.0;
|
|
|
}
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
return true;
|
|
|
}
|
|
|
#endif //TMC2130
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
-bool homeaxis(int axis, bool doError, uint8_t cnt, uint8_t* pstep)
|
|
|
+static void check_Z_crash(void)
|
|
|
+{
|
|
|
+ if (READ(Z_TMC2130_DIAG) != 0) { //Z crash
|
|
|
+ FORCE_HIGH_POWER_END;
|
|
|
+ current_position[Z_AXIS] = 0;
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
+ current_position[Z_AXIS] += MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]);
|
|
|
+ st_synchronize();
|
|
|
+ kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
|
|
|
+ }
|
|
|
+}
|
|
|
+#endif //TMC2130
|
|
|
+
|
|
|
+#ifdef TMC2130
|
|
|
+void homeaxis(int axis, uint8_t cnt, uint8_t* pstep)
|
|
|
#else
|
|
|
-bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
+void homeaxis(int axis, uint8_t cnt)
|
|
|
#endif //TMC2130
|
|
|
{
|
|
|
bool endstops_enabled = enable_endstops(true); //RP: endstops should be allways enabled durring homing
|
|
@@ -2219,24 +2333,24 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
// and the following movement to endstop has a chance to achieve the required velocity
|
|
|
// for the stall guard to work.
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
set_destination_to_current();
|
|
|
// destination[axis] = 11.f;
|
|
|
destination[axis] = -3.f * axis_home_dir;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
// Move away from the possible collision with opposite endstop with the collision detection disabled.
|
|
|
endstops_hit_on_purpose();
|
|
|
enable_endstops(false);
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[axis] = 1. * axis_home_dir;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
// Now continue to move up to the left end stop with the collision detection enabled.
|
|
|
enable_endstops(true);
|
|
|
destination[axis] = 1.1 * axis_home_dir * max_length(axis);
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
for (uint8_t i = 0; i < cnt; i++)
|
|
|
{
|
|
@@ -2244,9 +2358,9 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
endstops_hit_on_purpose();
|
|
|
enable_endstops(false);
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[axis] = -10.f * axis_home_dir;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
endstops_hit_on_purpose();
|
|
|
// Now move left up to the collision, this time with a repeatable velocity.
|
|
@@ -2257,7 +2371,7 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
#else //TMC2130
|
|
|
feedrate = homing_feedrate[axis] / 2;
|
|
|
#endif //TMC2130
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
uint16_t mscnt = tmc2130_rd_MSCNT(axis);
|
|
@@ -2291,10 +2405,10 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
float dist = - axis_home_dir * 0.01f * 64;
|
|
|
#endif //TMC2130
|
|
|
current_position[axis] -= dist;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
current_position[axis] += dist;
|
|
|
destination[axis] = current_position[axis];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], 0.5f*feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(0.5f*feedrate/60);
|
|
|
st_synchronize();
|
|
|
|
|
|
feedrate = 0.0;
|
|
@@ -2306,37 +2420,25 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
#endif
|
|
|
int axis_home_dir = home_dir(axis);
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[axis] = 1.5 * max_length(axis) * axis_home_dir;
|
|
|
feedrate = homing_feedrate[axis];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
- if (READ(Z_TMC2130_DIAG) != 0) { //Z crash
|
|
|
- FORCE_HIGH_POWER_END;
|
|
|
- if (doError) kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
|
|
|
- current_position[axis] = -5; //assume that nozzle crashed into bed
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- return 0;
|
|
|
- }
|
|
|
+ check_Z_crash();
|
|
|
#endif //TMC2130
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[axis] = -home_retract_mm(axis) * axis_home_dir;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
destination[axis] = 2*home_retract_mm(axis) * axis_home_dir;
|
|
|
feedrate = homing_feedrate[axis]/2 ;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
- if (READ(Z_TMC2130_DIAG) != 0) { //Z crash
|
|
|
- FORCE_HIGH_POWER_END;
|
|
|
- if (doError) kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW));
|
|
|
- current_position[axis] = -5; //assume that nozzle crashed into bed
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- return 0;
|
|
|
- }
|
|
|
+ check_Z_crash();
|
|
|
#endif //TMC2130
|
|
|
axis_is_at_home(axis);
|
|
|
destination[axis] = current_position[axis];
|
|
@@ -2348,7 +2450,6 @@ bool homeaxis(int axis, bool doError, uint8_t cnt)
|
|
|
#endif
|
|
|
}
|
|
|
enable_endstops(endstops_enabled);
|
|
|
- return 1;
|
|
|
}
|
|
|
|
|
|
/**/
|
|
@@ -2357,7 +2458,7 @@ void home_xy()
|
|
|
set_destination_to_current();
|
|
|
homeaxis(X_AXIS);
|
|
|
homeaxis(Y_AXIS);
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
endstops_hit_on_purpose();
|
|
|
}
|
|
|
|
|
@@ -2380,7 +2481,7 @@ void refresh_cmd_timeout(void)
|
|
|
retracted[active_extruder]=true;
|
|
|
prepare_move();
|
|
|
current_position[Z_AXIS]-=cs.retract_zlift;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
prepare_move();
|
|
|
feedrate = oldFeedrate;
|
|
|
} else if(!retracting && retracted[active_extruder]) {
|
|
@@ -2389,7 +2490,7 @@ void refresh_cmd_timeout(void)
|
|
|
destination[Z_AXIS]=current_position[Z_AXIS];
|
|
|
destination[E_AXIS]=current_position[E_AXIS];
|
|
|
current_position[Z_AXIS]+=cs.retract_zlift;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f;
|
|
|
plan_set_e_position(current_position[E_AXIS]);
|
|
|
float oldFeedrate = feedrate;
|
|
@@ -2513,6 +2614,95 @@ void force_high_power_mode(bool start_high_power_section) {
|
|
|
}
|
|
|
#endif //TMC2130
|
|
|
|
|
|
+void gcode_M105(uint8_t extruder)
|
|
|
+{
|
|
|
+#if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
|
|
|
+ SERIAL_PROTOCOLPGM("T:");
|
|
|
+ SERIAL_PROTOCOL_F(degHotend(extruder),1);
|
|
|
+ SERIAL_PROTOCOLPGM(" /");
|
|
|
+ SERIAL_PROTOCOL_F(degTargetHotend(extruder),1);
|
|
|
+#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
+ SERIAL_PROTOCOLPGM(" B:");
|
|
|
+ SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
+ SERIAL_PROTOCOLPGM(" /");
|
|
|
+ SERIAL_PROTOCOL_F(degTargetBed(),1);
|
|
|
+#endif //TEMP_BED_PIN
|
|
|
+ for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
|
|
+ SERIAL_PROTOCOLPGM(" T");
|
|
|
+ SERIAL_PROTOCOL(cur_extruder);
|
|
|
+ SERIAL_PROTOCOL(':');
|
|
|
+ SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
|
|
+ SERIAL_PROTOCOLPGM(" /");
|
|
|
+ SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
|
|
|
+ }
|
|
|
+#else
|
|
|
+ SERIAL_ERROR_START;
|
|
|
+ SERIAL_ERRORLNRPGM(_i("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS
|
|
|
+#endif
|
|
|
+
|
|
|
+ SERIAL_PROTOCOLPGM(" @:");
|
|
|
+#ifdef EXTRUDER_WATTS
|
|
|
+ SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127);
|
|
|
+ SERIAL_PROTOCOLPGM("W");
|
|
|
+#else
|
|
|
+ SERIAL_PROTOCOL(getHeaterPower(extruder));
|
|
|
+#endif
|
|
|
+
|
|
|
+ SERIAL_PROTOCOLPGM(" B@:");
|
|
|
+#ifdef BED_WATTS
|
|
|
+ SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127);
|
|
|
+ SERIAL_PROTOCOLPGM("W");
|
|
|
+#else
|
|
|
+ SERIAL_PROTOCOL(getHeaterPower(-1));
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef PINDA_THERMISTOR
|
|
|
+ SERIAL_PROTOCOLPGM(" P:");
|
|
|
+ SERIAL_PROTOCOL_F(current_temperature_pinda,1);
|
|
|
+#endif //PINDA_THERMISTOR
|
|
|
+
|
|
|
+#ifdef AMBIENT_THERMISTOR
|
|
|
+ SERIAL_PROTOCOLPGM(" A:");
|
|
|
+ SERIAL_PROTOCOL_F(current_temperature_ambient,1);
|
|
|
+#endif //AMBIENT_THERMISTOR
|
|
|
+
|
|
|
+
|
|
|
+#ifdef SHOW_TEMP_ADC_VALUES
|
|
|
+ {
|
|
|
+ float raw = 0.0;
|
|
|
+#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
+ SERIAL_PROTOCOLPGM(" ADC B:");
|
|
|
+ SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
+ SERIAL_PROTOCOLPGM("C->");
|
|
|
+ raw = rawBedTemp();
|
|
|
+ SERIAL_PROTOCOL_F(raw/OVERSAMPLENR,5);
|
|
|
+ SERIAL_PROTOCOLPGM(" Rb->");
|
|
|
+ SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5);
|
|
|
+ SERIAL_PROTOCOLPGM(" Rxb->");
|
|
|
+ SERIAL_PROTOCOL_F(raw, 5);
|
|
|
+#endif
|
|
|
+ for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
|
|
+ SERIAL_PROTOCOLPGM(" T");
|
|
|
+ SERIAL_PROTOCOL(cur_extruder);
|
|
|
+ SERIAL_PROTOCOLPGM(":");
|
|
|
+ SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
|
|
+ SERIAL_PROTOCOLPGM("C->");
|
|
|
+ raw = rawHotendTemp(cur_extruder);
|
|
|
+ SERIAL_PROTOCOL_F(raw/OVERSAMPLENR,5);
|
|
|
+ SERIAL_PROTOCOLPGM(" Rt");
|
|
|
+ SERIAL_PROTOCOL(cur_extruder);
|
|
|
+ SERIAL_PROTOCOLPGM("->");
|
|
|
+ SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5);
|
|
|
+ SERIAL_PROTOCOLPGM(" Rx");
|
|
|
+ SERIAL_PROTOCOL(cur_extruder);
|
|
|
+ SERIAL_PROTOCOLPGM("->");
|
|
|
+ SERIAL_PROTOCOL_F(raw, 5);
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
+}
|
|
|
+
|
|
|
#ifdef TMC2130
|
|
|
static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, long home_y_value, bool home_z_axis, long home_z_value, bool calib, bool without_mbl)
|
|
|
#else
|
|
@@ -2592,7 +2782,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
|
|
|
int x_axis_home_dir = home_dir(X_AXIS);
|
|
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
|
|
|
feedrate = homing_feedrate[X_AXIS];
|
|
|
if(homing_feedrate[Y_AXIS]<feedrate)
|
|
@@ -2602,15 +2792,15 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
} else {
|
|
|
feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
|
|
|
}
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
st_synchronize();
|
|
|
|
|
|
axis_is_at_home(X_AXIS);
|
|
|
axis_is_at_home(Y_AXIS);
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[X_AXIS] = current_position[X_AXIS];
|
|
|
destination[Y_AXIS] = current_position[Y_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
feedrate = 0.0;
|
|
|
st_synchronize();
|
|
|
endstops_hit_on_purpose();
|
|
@@ -2674,14 +2864,14 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
MYSERIAL.println(current_position[X_AXIS]);MYSERIAL.println(current_position[Y_AXIS]);
|
|
|
MYSERIAL.println(current_position[Z_AXIS]);MYSERIAL.println(current_position[E_AXIS]);
|
|
|
#endif
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
#ifdef DEBUG_BUILD
|
|
|
SERIAL_ECHOLNPGM("plan_buffer_line()");
|
|
|
MYSERIAL.println(destination[X_AXIS]);MYSERIAL.println(destination[Y_AXIS]);
|
|
|
MYSERIAL.println(destination[Z_AXIS]);MYSERIAL.println(destination[E_AXIS]);
|
|
|
MYSERIAL.println(feedrate);MYSERIAL.println(active_extruder);
|
|
|
#endif
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate);
|
|
|
st_synchronize();
|
|
|
current_position[X_AXIS] = destination[X_AXIS];
|
|
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
|
@@ -2700,8 +2890,8 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
feedrate = XY_TRAVEL_SPEED/60;
|
|
|
current_position[Z_AXIS] = 0;
|
|
|
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate);
|
|
|
st_synchronize();
|
|
|
current_position[X_AXIS] = destination[X_AXIS];
|
|
|
current_position[Y_AXIS] = destination[Y_AXIS];
|
|
@@ -2717,10 +2907,10 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
&& (current_position[Y_AXIS]+Y_PROBE_OFFSET_FROM_EXTRUDER <= Y_MAX_POS)) {
|
|
|
|
|
|
current_position[Z_AXIS] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
destination[Z_AXIS] = Z_RAISE_BEFORE_HOMING * home_dir(Z_AXIS) * (-1); // Set destination away from bed
|
|
|
feedrate = max_feedrate[Z_AXIS];
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate);
|
|
|
st_synchronize();
|
|
|
|
|
|
homeaxis(Z_AXIS);
|
|
@@ -2747,7 +2937,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
// Set the planner and stepper routine positions.
|
|
|
// At this point the mesh bed leveling and world2machine corrections are disabled and current_position
|
|
|
// contains the machine coordinates.
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
#ifdef ENDSTOPS_ONLY_FOR_HOMING
|
|
|
enable_endstops(false);
|
|
@@ -2854,12 +3044,14 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
//set_destination_to_current();
|
|
|
int l_feedmultiply = setup_for_endstop_move();
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME));
|
|
|
+ raise_z_above(MESH_HOME_Z_SEARCH);
|
|
|
+ st_synchronize();
|
|
|
home_xy();
|
|
|
|
|
|
enable_endstops(false);
|
|
|
current_position[X_AXIS] += 5;
|
|
|
current_position[Y_AXIS] += 5;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
|
|
|
// Let the user move the Z axes up to the end stoppers.
|
|
@@ -2909,7 +3101,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
|
|
|
bool endstops_enabled = enable_endstops(false);
|
|
|
current_position[Z_AXIS] -= 1; //move 1mm down with disabled endstop
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
|
|
|
// Move the print head close to the bed.
|
|
@@ -2920,7 +3112,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
#endif //TMC2130
|
|
|
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
@@ -2961,7 +3153,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
clean_up_after_endstop_move(l_feedmultiply);
|
|
|
// Print head up.
|
|
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
//#ifndef NEW_XYZCAL
|
|
|
if (result >= 0)
|
|
@@ -2981,7 +3173,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
clean_up_after_endstop_move(l_feedmultiply);
|
|
|
// Print head up.
|
|
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
// if (result >= 0) babystep_apply();
|
|
|
#endif //HEATBED_V2
|
|
@@ -3043,9 +3235,16 @@ void gcode_M114()
|
|
|
SERIAL_PROTOCOLPGM(" E:");
|
|
|
SERIAL_PROTOCOL(float(st_get_position(E_AXIS)) / cs.axis_steps_per_unit[E_AXIS]);
|
|
|
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+void gcode_M123()
|
|
|
+{
|
|
|
+ printf_P(_N("E0:%d RPM PRN1:%d RPM E0@:%u PRN1@:%d\n"), 60*fan_speed[active_extruder], 60*fan_speed[1], newFanSpeed, fanSpeed);
|
|
|
+}
|
|
|
+#endif //FANCHECK and TACH_0 or TACH_1
|
|
|
+
|
|
|
//! extracted code to compute z_shift for M600 in case of filament change operation
|
|
|
//! requested from fsensors.
|
|
|
//! The function ensures, that the printhead lifts to at least 25mm above the heat bed
|
|
@@ -3094,18 +3293,18 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
|
|
|
//Retract E
|
|
|
current_position[E_AXIS] += e_shift;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED);
|
|
|
st_synchronize();
|
|
|
|
|
|
//Lift Z
|
|
|
current_position[Z_AXIS] += z_shift;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_ZFEED, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_ZFEED);
|
|
|
st_synchronize();
|
|
|
|
|
|
//Move XY to side
|
|
|
current_position[X_AXIS] = x_position;
|
|
|
current_position[Y_AXIS] = y_position;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
|
|
st_synchronize();
|
|
|
|
|
|
//Beep, manage nozzle heater and wait for user to start unload filament
|
|
@@ -3127,10 +3326,9 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
if (lcd_change_fil_state == 0)
|
|
|
{
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
current_position[X_AXIS] -= 100;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
|
|
st_synchronize();
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
|
|
}
|
|
@@ -3144,8 +3342,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
if (saved_printing) {
|
|
|
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
|
|
|
mmu_command(MmuCmd::R0);
|
|
|
manage_response(false, false);
|
|
@@ -3167,7 +3364,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
|
|
if (!automatic)
|
|
|
{
|
|
|
current_position[E_AXIS] += FILAMENTCHANGE_RECFEED;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED);
|
|
|
}
|
|
|
|
|
|
//Move XY back
|
|
@@ -3225,12 +3422,12 @@ void gcode_M701()
|
|
|
|
|
|
lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));
|
|
|
current_position[E_AXIS] += 40;
|
|
|
- plan_buffer_line_curposXYZE(400 / 60, active_extruder); //fast sequence
|
|
|
+ plan_buffer_line_curposXYZE(400 / 60); //fast sequence
|
|
|
st_synchronize();
|
|
|
|
|
|
raise_z_above(MIN_Z_FOR_LOAD, false);
|
|
|
current_position[E_AXIS] += 30;
|
|
|
- plan_buffer_line_curposXYZE(400 / 60, active_extruder); //fast sequence
|
|
|
+ plan_buffer_line_curposXYZE(400 / 60); //fast sequence
|
|
|
|
|
|
load_filament_final_feed(); //slow sequence
|
|
|
st_synchronize();
|
|
@@ -3266,47 +3463,35 @@ void gcode_M701()
|
|
|
*
|
|
|
* Typical format of S/N is:CZPX0917X003XC13518
|
|
|
*
|
|
|
- * Command operates only in farm mode, if not in farm mode, "Not in farm mode." is written to MYSERIAL.
|
|
|
- *
|
|
|
* Send command ;S to serial port 0 to retrieve serial number stored in 32U2 processor,
|
|
|
- * reply is transmitted to serial port 1 character by character.
|
|
|
+ * reply is stored in *SN.
|
|
|
* Operation takes typically 23 ms. If the retransmit is not finished until 100 ms,
|
|
|
- * it is interrupted, so less, or no characters are retransmitted, only newline character is send
|
|
|
- * in any case.
|
|
|
+ * it is interrupted, so less, or no characters are retransmitted, the function returns false
|
|
|
+ * The command will fail if the 32U2 processor is unpowered via USB since it is isolated from the rest of the electronics.
|
|
|
+ * In that case the value that is stored in the EEPROM should be used instead.
|
|
|
+ *
|
|
|
+ * @return 1 on success
|
|
|
+ * @return 0 on general failure
|
|
|
*/
|
|
|
-static void gcode_PRUSA_SN()
|
|
|
+static bool get_PRUSA_SN(char* SN)
|
|
|
{
|
|
|
- if (farm_mode) {
|
|
|
- selectedSerialPort = 0;
|
|
|
- putchar(';');
|
|
|
- putchar('S');
|
|
|
- int numbersRead = 0;
|
|
|
- ShortTimer timeout;
|
|
|
- timeout.start();
|
|
|
-
|
|
|
- while (numbersRead < 19) {
|
|
|
- while (MSerial.available() > 0) {
|
|
|
- uint8_t serial_char = MSerial.read();
|
|
|
- selectedSerialPort = 1;
|
|
|
- putchar(serial_char);
|
|
|
- numbersRead++;
|
|
|
- selectedSerialPort = 0;
|
|
|
- }
|
|
|
- if (timeout.expired(100u)) break;
|
|
|
- }
|
|
|
- selectedSerialPort = 1;
|
|
|
- putchar('\n');
|
|
|
-#if 0
|
|
|
- for (int b = 0; b < 3; b++) {
|
|
|
- _tone(BEEPER, 110);
|
|
|
- _delay(50);
|
|
|
- _noTone(BEEPER);
|
|
|
- _delay(50);
|
|
|
+ uint8_t selectedSerialPort_bak = selectedSerialPort;
|
|
|
+ selectedSerialPort = 0;
|
|
|
+ SERIAL_ECHOLNRPGM(PSTR(";S"));
|
|
|
+ uint8_t numbersRead = 0;
|
|
|
+ ShortTimer timeout;
|
|
|
+ timeout.start();
|
|
|
+
|
|
|
+ while (numbersRead < 19) {
|
|
|
+ if (MSerial.available() > 0) {
|
|
|
+ SN[numbersRead] = MSerial.read();
|
|
|
+ numbersRead++;
|
|
|
}
|
|
|
-#endif
|
|
|
- } else {
|
|
|
- puts_P(_N("Not in farm mode."));
|
|
|
+ if (timeout.expired(100u)) break;
|
|
|
}
|
|
|
+ SN[numbersRead] = 0;
|
|
|
+ selectedSerialPort = selectedSerialPort_bak;
|
|
|
+ return (numbersRead == 19);
|
|
|
}
|
|
|
//! Detection of faulty RAMBo 1.1b boards equipped with bigger capacitors
|
|
|
//! at the TACH_1 pin, which causes bad detection of print fan speed.
|
|
@@ -3396,11 +3581,29 @@ static void gcode_G92()
|
|
|
current_position[E_AXIS] = values[E_AXIS];
|
|
|
|
|
|
// Set all at once
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS],
|
|
|
- current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#ifdef EXTENDED_CAPABILITIES_REPORT
|
|
|
+
|
|
|
+static void cap_line(const char* name, bool ena = false) {
|
|
|
+ printf_P(PSTR("Cap:%S:%c\n"), name, (char)ena + '0');
|
|
|
+}
|
|
|
+
|
|
|
+static void extended_capabilities_report()
|
|
|
+{
|
|
|
+ // AUTOREPORT_TEMP (M155)
|
|
|
+ cap_line(PSTR("AUTOREPORT_TEMP"), ENABLED(AUTO_REPORT));
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+ // AUTOREPORT_FANS (M123)
|
|
|
+ cap_line(PSTR("AUTOREPORT_FANS"), ENABLED(AUTO_REPORT));
|
|
|
+#endif //FANCHECK and TACH_0 or TACH_1
|
|
|
+ // AUTOREPORT_POSITION (M114)
|
|
|
+ cap_line(PSTR("AUTOREPORT_POSITION"), ENABLED(AUTO_REPORT));
|
|
|
+ //@todo Update RepRap cap
|
|
|
+}
|
|
|
+#endif //EXTENDED_CAPABILITIES_REPORT
|
|
|
|
|
|
#ifdef BACKLASH_X
|
|
|
extern uint8_t st_backlash_x;
|
|
@@ -3488,12 +3691,14 @@ extern uint8_t st_backlash_y;
|
|
|
//!@n M115 - Capabilities string
|
|
|
//!@n M117 - display message
|
|
|
//!@n M119 - Output Endstop status to serial port
|
|
|
+//!@n M123 - Tachometer value
|
|
|
//!@n M126 - Solenoid Air Valve Open (BariCUDA support by jmil)
|
|
|
//!@n M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil)
|
|
|
//!@n M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
|
|
//!@n M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
|
|
|
//!@n M140 - Set bed target temp
|
|
|
//!@n M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work.
|
|
|
+//!@n M155 - Automatically send temperatures, fan speeds, position
|
|
|
//!@n M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
|
|
|
//! Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
|
|
|
//!@n M200 D<millimeters>- set filament diameter and set E axis units to cubic millimeters (use S0 to set back to millimeters).
|
|
@@ -3531,6 +3736,7 @@ extern uint8_t st_backlash_y;
|
|
|
//!@n M503 - print the current settings (from memory not from EEPROM)
|
|
|
//!@n M509 - force language selection on next restart
|
|
|
//!@n M540 - Use S[0|1] to enable or disable the stop SD card print on endstop hit (requires ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
|
|
|
+//!@n M552 - Set IP address
|
|
|
//!@n M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
|
|
|
//!@n M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
|
|
|
//!@n M860 - Wait for PINDA thermistor to reach target temperature.
|
|
@@ -3559,14 +3765,12 @@ There are reasons why some G Codes aren't in numerical order.
|
|
|
void process_commands()
|
|
|
{
|
|
|
#ifdef FANCHECK
|
|
|
- if(fan_check_error){
|
|
|
- if(fan_check_error == EFCE_DETECTED){
|
|
|
- fan_check_error = EFCE_REPORTED;
|
|
|
- // SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
- lcd_pause_print();
|
|
|
- } // otherwise it has already been reported, so just ignore further processing
|
|
|
- return; //ignore usb stream. It is reenabled by selecting resume from the lcd.
|
|
|
- }
|
|
|
+ if(fan_check_error == EFCE_DETECTED){
|
|
|
+ fan_check_error = EFCE_REPORTED;
|
|
|
+ // SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
+ lcd_pause_print();
|
|
|
+ cmdqueue_serial_disabled = true;
|
|
|
+ }
|
|
|
#endif
|
|
|
|
|
|
if (!buflen) return; //empty command
|
|
@@ -3616,7 +3820,7 @@ void process_commands()
|
|
|
- TMC_SET_STEP
|
|
|
- TMC_SET_CHOP
|
|
|
*/
|
|
|
- if (code_seen("M117")) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^"
|
|
|
+ if (code_seen_P(PSTR("M117"))) { //moved to highest priority place to be able to to print strings which includes "G", "PRUSA" and "^"
|
|
|
starpos = (strchr(strchr_pointer + 5, '*'));
|
|
|
if (starpos != NULL)
|
|
|
*(starpos) = '\0';
|
|
@@ -3629,7 +3833,7 @@ void process_commands()
|
|
|
|
|
|
// ### CRASH_DETECTED - TMC2130
|
|
|
// ---------------------------------
|
|
|
- if(code_seen("CRASH_DETECTED"))
|
|
|
+ if(code_seen_P(PSTR("CRASH_DETECTED")))
|
|
|
{
|
|
|
uint8_t mask = 0;
|
|
|
if (code_seen('X')) mask |= X_AXIS_MASK;
|
|
@@ -3639,12 +3843,12 @@ void process_commands()
|
|
|
|
|
|
// ### CRASH_RECOVER - TMC2130
|
|
|
// ----------------------------------
|
|
|
- else if(code_seen("CRASH_RECOVER"))
|
|
|
+ else if(code_seen_P(PSTR("CRASH_RECOVER")))
|
|
|
crashdet_recover();
|
|
|
|
|
|
// ### CRASH_CANCEL - TMC2130
|
|
|
// ----------------------------------
|
|
|
- else if(code_seen("CRASH_CANCEL"))
|
|
|
+ else if(code_seen_P(PSTR("CRASH_CANCEL")))
|
|
|
crashdet_cancel();
|
|
|
}
|
|
|
else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0)
|
|
@@ -3730,7 +3934,7 @@ void process_commands()
|
|
|
}
|
|
|
#endif //BACKLASH_Y
|
|
|
#endif //TMC2130
|
|
|
- else if(code_seen("PRUSA")){
|
|
|
+ else if(code_seen_P(PSTR("PRUSA"))){
|
|
|
/*!
|
|
|
---------------------------------------------------------------------------------
|
|
|
### PRUSA - Internal command set <a href="https://reprap.org/wiki/G-code#G98:_Activate_farm_mode">G98: Activate farm mode - Notes</a>
|
|
@@ -3763,58 +3967,43 @@ void process_commands()
|
|
|
*/
|
|
|
|
|
|
|
|
|
- if (code_seen("Ping")) { // PRUSA Ping
|
|
|
+ if (code_seen_P(PSTR("Ping"))) { // PRUSA Ping
|
|
|
if (farm_mode) {
|
|
|
PingTime = _millis();
|
|
|
- //MYSERIAL.print(farm_no); MYSERIAL.println(": OK");
|
|
|
}
|
|
|
}
|
|
|
- else if (code_seen("PRN")) { // PRUSA PRN
|
|
|
+ else if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN
|
|
|
printf_P(_N("%d"), status_number);
|
|
|
|
|
|
- } else if( code_seen("FANPINTST") ){
|
|
|
+ } else if( code_seen_P(PSTR("FANPINTST"))){
|
|
|
gcode_PRUSA_BadRAMBoFanTest();
|
|
|
- }else if (code_seen("FAN")) { // PRUSA FAN
|
|
|
+ }else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN
|
|
|
printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]);
|
|
|
- }else if (code_seen("fn")) { // PRUSA fn
|
|
|
- if (farm_mode) {
|
|
|
- printf_P(_N("%d"), farm_no);
|
|
|
- }
|
|
|
- else {
|
|
|
- puts_P(_N("Not in farm mode."));
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
- else if (code_seen("thx")) // PRUSA thx
|
|
|
+ else if (code_seen_P(PSTR("thx"))) // PRUSA thx
|
|
|
{
|
|
|
no_response = false;
|
|
|
}
|
|
|
- else if (code_seen("uvlo")) // PRUSA uvlo
|
|
|
+ else if (code_seen_P(PSTR("uvlo"))) // PRUSA uvlo
|
|
|
{
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_UVLO,0);
|
|
|
enquecommand_P(PSTR("M24"));
|
|
|
}
|
|
|
- else if (code_seen("MMURES")) // PRUSA MMURES
|
|
|
+ else if (code_seen_P(PSTR("MMURES"))) // PRUSA MMURES
|
|
|
{
|
|
|
mmu_reset();
|
|
|
}
|
|
|
- else if (code_seen("RESET")) { // PRUSA RESET
|
|
|
- // careful!
|
|
|
- if (farm_mode) {
|
|
|
-#if (defined(WATCHDOG) && (MOTHERBOARD == BOARD_EINSY_1_0a))
|
|
|
- boot_app_magic = BOOT_APP_MAGIC;
|
|
|
- boot_app_flags = BOOT_APP_FLG_RUN;
|
|
|
- wdt_enable(WDTO_15MS);
|
|
|
- cli();
|
|
|
- while(1);
|
|
|
-#else //WATCHDOG
|
|
|
- asm volatile("jmp 0x3E000");
|
|
|
-#endif //WATCHDOG
|
|
|
- }
|
|
|
- else {
|
|
|
- MYSERIAL.println("Not in farm mode.");
|
|
|
- }
|
|
|
- }else if (code_seen("fv")) { // PRUSA fv
|
|
|
+ else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET
|
|
|
+#ifdef WATCHDOG
|
|
|
+#if defined(W25X20CL) && defined(BOOTAPP)
|
|
|
+ boot_app_magic = BOOT_APP_MAGIC;
|
|
|
+ boot_app_flags = BOOT_APP_FLG_RUN;
|
|
|
+#endif //defined(W25X20CL) && defined(BOOTAPP)
|
|
|
+ softReset();
|
|
|
+#elif defined(BOOTAPP) //this is a safety precaution. This is because the new bootloader turns off the heaters, but the old one doesn't. The watchdog should be used most of the time.
|
|
|
+ asm volatile("jmp 0x3E000");
|
|
|
+#endif
|
|
|
+ }else if (code_seen_P("fv")) { // PRUSA fv
|
|
|
// get file version
|
|
|
#ifdef SDSUPPORT
|
|
|
card.openFile(strchr_pointer + 3,true);
|
|
@@ -3829,38 +4018,43 @@ void process_commands()
|
|
|
|
|
|
#endif // SDSUPPORT
|
|
|
|
|
|
- } else if (code_seen("M28")) { // PRUSA M28
|
|
|
+ } else if (code_seen_P(PSTR("M28"))) { // PRUSA M28
|
|
|
trace();
|
|
|
prusa_sd_card_upload = true;
|
|
|
card.openFile(strchr_pointer+4,false);
|
|
|
|
|
|
- } else if (code_seen("SN")) { // PRUSA SN
|
|
|
- gcode_PRUSA_SN();
|
|
|
+ } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN
|
|
|
+ char SN[20];
|
|
|
+ eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20);
|
|
|
+ if (SN[19])
|
|
|
+ puts_P(PSTR("SN invalid"));
|
|
|
+ else
|
|
|
+ puts(SN);
|
|
|
|
|
|
- } else if(code_seen("Fir")){ // PRUSA Fir
|
|
|
+ } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir
|
|
|
|
|
|
SERIAL_PROTOCOLLN(FW_VERSION_FULL);
|
|
|
|
|
|
- } else if(code_seen("Rev")){ // PRUSA Rev
|
|
|
+ } else if(code_seen_P(PSTR("Rev"))){ // PRUSA Rev
|
|
|
|
|
|
SERIAL_PROTOCOLLN(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE );
|
|
|
|
|
|
- } else if(code_seen("Lang")) { // PRUSA Lang
|
|
|
+ } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang
|
|
|
lang_reset();
|
|
|
|
|
|
- } else if(code_seen("Lz")) { // PRUSA Lz
|
|
|
+ } else if(code_seen_P(PSTR("Lz"))) { // PRUSA Lz
|
|
|
eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
|
|
|
|
|
- } else if(code_seen("Beat")) { // PRUSA Beat
|
|
|
+ } else if(code_seen_P(PSTR("Beat"))) { // PRUSA Beat
|
|
|
// Kick farm link timer
|
|
|
kicktime = _millis();
|
|
|
|
|
|
- } else if(code_seen("FR")) { // PRUSA FR
|
|
|
+ } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR
|
|
|
// Factory full reset
|
|
|
factory_reset(0);
|
|
|
- } else if(code_seen("MBL")) { // PRUSA MBL
|
|
|
+ } else if(code_seen_P(PSTR("MBL"))) { // PRUSA MBL
|
|
|
// Change the MBL status without changing the logical Z position.
|
|
|
- if(code_seen("V")) {
|
|
|
+ if(code_seen('V')) {
|
|
|
bool value = code_value_short();
|
|
|
st_synchronize();
|
|
|
if(value != mbl.active) {
|
|
@@ -3885,14 +4079,14 @@ eeprom_update_byte((uint8_t*)EEPROM_CHECK_MODE,0xFF);
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,0xFF);
|
|
|
eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,0xFFFF);
|
|
|
*/
|
|
|
- } else if (code_seen("nozzle")) { // PRUSA nozzle
|
|
|
+ } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle
|
|
|
uint16_t nDiameter;
|
|
|
if(code_seen('D'))
|
|
|
{
|
|
|
nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um]
|
|
|
nozzle_diameter_check(nDiameter);
|
|
|
}
|
|
|
- else if(code_seen("set") && farm_mode)
|
|
|
+ else if(code_seen_P(PSTR("set")) && farm_mode)
|
|
|
{
|
|
|
strchr_pointer++; // skip 1st char (~ 's')
|
|
|
strchr_pointer++; // skip 2nd char (~ 'e')
|
|
@@ -4274,6 +4468,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
#endif //FWRETRACT
|
|
|
|
|
|
|
|
|
+ /*!
|
|
|
+ ### G21 - Sets Units to Millimters <a href="https://reprap.org/wiki/G-code#G21:_Set_Units_to_Millimeters">G21: Set Units to Millimeters</a>
|
|
|
+ Units are in millimeters. Prusa doesn't support inches.
|
|
|
+ */
|
|
|
+ case 21:
|
|
|
+ break; //Doing nothing. This is just to prevent serial UNKOWN warnings.
|
|
|
+
|
|
|
+
|
|
|
/*!
|
|
|
### G28 - Home all Axes one at a time <a href="https://reprap.org/wiki/G-code#G28:_Move_to_Origin_.28Home.29">G28: Move to Origin (Home)</a>
|
|
|
Using `G28` without any parameters will perfom homing of all axes AND mesh bed leveling, while `G28 W` will just home all axes (no mesh bed leveling).
|
|
@@ -4350,7 +4552,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
current_position[X_AXIS] = uncorrected_position.x;
|
|
|
current_position[Y_AXIS] = uncorrected_position.y;
|
|
|
current_position[Z_AXIS] = uncorrected_position.z;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
int l_feedmultiply = setup_for_endstop_move();
|
|
|
|
|
|
feedrate = homing_feedrate[Z_AXIS];
|
|
@@ -4464,7 +4666,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
apply_rotation_xyz(plan_bed_level_matrix, x_tmp, y_tmp, z_tmp); //Apply the correction sending the probe offset
|
|
|
current_position[Z_AXIS] = z_tmp - real_z + current_position[Z_AXIS]; //The difference is added to current position and sent to planner.
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
}
|
|
|
break;
|
|
|
#ifndef Z_PROBE_SLED
|
|
@@ -4552,11 +4754,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
/*!
|
|
|
### G76 - PINDA probe temperature calibration <a href="https://reprap.org/wiki/G-code#G76:_PINDA_probe_temperature_calibration">G76: PINDA probe temperature calibration</a>
|
|
|
This G-code is used to calibrate the temperature drift of the PINDA (inductive Sensor).
|
|
|
-
|
|
|
+
|
|
|
The PINDAv2 sensor has a built-in thermistor which has the advantage that the calibration can be done once for all materials.
|
|
|
|
|
|
The Original i3 Prusa MK2/s uses PINDAv1 and this calibration improves the temperature drift, but not as good as the PINDAv2.
|
|
|
|
|
|
+ superPINDA sensor has internal temperature compensation and no thermistor output. There is no point of doing temperature calibration in such case.
|
|
|
+ If PINDA_THERMISTOR and SUPERPINDA_SUPPORT is defined during compilation, calibration is skipped with serial message "No PINDA thermistor".
|
|
|
+ This can be caused also if PINDA thermistor connection is broken or PINDA temperature is lower than PINDA_MINTEMP.
|
|
|
+
|
|
|
#### Example
|
|
|
|
|
|
```
|
|
@@ -4571,154 +4777,155 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
case 76:
|
|
|
{
|
|
|
#ifdef PINDA_THERMISTOR
|
|
|
- if (true)
|
|
|
- {
|
|
|
+ if (!has_temperature_compensation())
|
|
|
+ {
|
|
|
+ SERIAL_ECHOLNPGM("No PINDA thermistor");
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- if (calibration_status() >= CALIBRATION_STATUS_XYZ_CALIBRATION) {
|
|
|
- //we need to know accurate position of first calibration point
|
|
|
- //if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please run XYZ calibration first."));
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
|
|
|
- {
|
|
|
- // We don't know where we are! HOME!
|
|
|
- // Push the commands to the front of the message queue in the reverse order!
|
|
|
- // There shall be always enough space reserved for these commands.
|
|
|
- repeatcommand_front(); // repeat G76 with all its parameters
|
|
|
- enquecommand_front_P((PSTR("G28 W0")));
|
|
|
- break;
|
|
|
- }
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Stable ambient temperature 21-26C is needed a rigid stand is required."));////MSG_TEMP_CAL_WARNING c=20 r=4
|
|
|
- bool result = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, false);
|
|
|
-
|
|
|
- if (result)
|
|
|
- {
|
|
|
- current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[Z_AXIS] = 50;
|
|
|
- current_position[Y_AXIS] = 180;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
|
|
|
- current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
- current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
- gcode_G28(false, false, true);
|
|
|
+ if (calibration_status() >= CALIBRATION_STATUS_XYZ_CALIBRATION) {
|
|
|
+ //we need to know accurate position of first calibration point
|
|
|
+ //if xyz calibration was not performed yet, interrupt temperature calibration and inform user that xyz cal. is needed
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please run XYZ calibration first."));
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- if ((current_temperature_pinda > 35) && (farm_mode == false)) {
|
|
|
- //waiting for PIDNA probe to cool down in case that we are not in farm mode
|
|
|
- current_position[Z_AXIS] = 100;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails
|
|
|
- lcd_temp_cal_show_result(false);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- lcd_update_enable(true);
|
|
|
- KEEPALIVE_STATE(NOT_BUSY); //no need to print busy messages as we print current temperatures periodicaly
|
|
|
- SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
|
|
+ if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
|
|
|
+ {
|
|
|
+ // We don't know where we are! HOME!
|
|
|
+ // Push the commands to the front of the message queue in the reverse order!
|
|
|
+ // There shall be always enough space reserved for these commands.
|
|
|
+ repeatcommand_front(); // repeat G76 with all its parameters
|
|
|
+ enquecommand_front_P(G28W0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Stable ambient temperature 21-26C is needed a rigid stand is required."));////MSG_TEMP_CAL_WARNING c=20 r=4
|
|
|
+ bool result = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false, false);
|
|
|
|
|
|
- float zero_z;
|
|
|
- int z_shift = 0; //unit: steps
|
|
|
- float start_temp = 5 * (int)(current_temperature_pinda / 5);
|
|
|
- if (start_temp < 35) start_temp = 35;
|
|
|
- if (start_temp < current_temperature_pinda) start_temp += 5;
|
|
|
- printf_P(_N("start temperature: %.1f\n"), start_temp);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[Z_AXIS] = 50;
|
|
|
+ current_position[Y_AXIS] = 180;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET));
|
|
|
+ current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
+ current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
+ gcode_G28(false, false, true);
|
|
|
+
|
|
|
+ }
|
|
|
+ if ((current_temperature_pinda > 35) && (farm_mode == false)) {
|
|
|
+ //waiting for PIDNA probe to cool down in case that we are not in farm mode
|
|
|
+ current_position[Z_AXIS] = 100;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails
|
|
|
+ lcd_temp_cal_show_result(false);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lcd_update_enable(true);
|
|
|
+ KEEPALIVE_STATE(NOT_BUSY); //no need to print busy messages as we print current temperatures periodicaly
|
|
|
+ SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
|
|
+
|
|
|
+ float zero_z;
|
|
|
+ int z_shift = 0; //unit: steps
|
|
|
+ float start_temp = 5 * (int)(current_temperature_pinda / 5);
|
|
|
+ if (start_temp < 35) start_temp = 35;
|
|
|
+ if (start_temp < current_temperature_pinda) start_temp += 5;
|
|
|
+ printf_P(_N("start temperature: %.1f\n"), start_temp);
|
|
|
|
|
|
// setTargetHotend(200, 0);
|
|
|
- setTargetBed(70 + (start_temp - 30));
|
|
|
+ setTargetBed(70 + (start_temp - 30));
|
|
|
|
|
|
- custom_message_type = CustomMsg::TempCal;
|
|
|
- custom_message_state = 1;
|
|
|
- lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION));
|
|
|
- current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
- current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
+ custom_message_type = CustomMsg::TempCal;
|
|
|
+ custom_message_state = 1;
|
|
|
+ lcd_setstatuspgm(_T(MSG_TEMP_CALIBRATION));
|
|
|
+ current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
+ current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
|
|
|
- while (current_temperature_pinda < start_temp)
|
|
|
- {
|
|
|
- delay_keep_alive(1000);
|
|
|
- serialecho_temperatures();
|
|
|
- }
|
|
|
+ while (current_temperature_pinda < start_temp)
|
|
|
+ {
|
|
|
+ delay_keep_alive(1000);
|
|
|
+ serialecho_temperatures();
|
|
|
+ }
|
|
|
|
|
|
- eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
|
|
|
|
|
- current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
- current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
+ current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
+ current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
|
|
|
- bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
|
- if (find_z_result == false) {
|
|
|
- lcd_temp_cal_show_result(find_z_result);
|
|
|
- break;
|
|
|
- }
|
|
|
- zero_z = current_position[Z_AXIS];
|
|
|
+ bool find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
|
+ if (find_z_result == false) {
|
|
|
+ lcd_temp_cal_show_result(find_z_result);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ zero_z = current_position[Z_AXIS];
|
|
|
|
|
|
- printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]);
|
|
|
+ printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]);
|
|
|
|
|
|
- int i = -1; for (; i < 5; i++)
|
|
|
- {
|
|
|
- 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));
|
|
|
- if (i >= 0) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
- if (start_temp <= temp) break;
|
|
|
- }
|
|
|
+ int i = -1; for (; i < 5; i++)
|
|
|
+ {
|
|
|
+ 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));
|
|
|
+ if (i >= 0) EEPROM_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
+ if (start_temp <= temp) break;
|
|
|
+ }
|
|
|
|
|
|
- for (i++; i < 5; i++)
|
|
|
- {
|
|
|
- float temp = (40 + i * 5);
|
|
|
- printf_P(_N("\nStep: %d/6\n"), i + 2);
|
|
|
- custom_message_state = i + 2;
|
|
|
- setTargetBed(50 + 10 * (temp - 30) / 5);
|
|
|
+ for (i++; i < 5; i++)
|
|
|
+ {
|
|
|
+ float temp = (40 + i * 5);
|
|
|
+ printf_P(_N("\nStep: %d/6\n"), i + 2);
|
|
|
+ custom_message_state = i + 2;
|
|
|
+ setTargetBed(50 + 10 * (temp - 30) / 5);
|
|
|
// setTargetHotend(255, 0);
|
|
|
- current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
- current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
- while (current_temperature_pinda < temp)
|
|
|
- {
|
|
|
- delay_keep_alive(1000);
|
|
|
- serialecho_temperatures();
|
|
|
- }
|
|
|
- current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
- current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
- st_synchronize();
|
|
|
- find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
|
- if (find_z_result == false) {
|
|
|
- lcd_temp_cal_show_result(find_z_result);
|
|
|
- break;
|
|
|
- }
|
|
|
- z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
|
|
|
+ current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
+ current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
+ while (current_temperature_pinda < temp)
|
|
|
+ {
|
|
|
+ delay_keep_alive(1000);
|
|
|
+ serialecho_temperatures();
|
|
|
+ }
|
|
|
+ current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
+ current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
+ st_synchronize();
|
|
|
+ find_z_result = find_bed_induction_sensor_point_z(-1.f);
|
|
|
+ if (find_z_result == false) {
|
|
|
+ lcd_temp_cal_show_result(find_z_result);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
|
|
|
|
|
|
- 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_save_B(EEPROM_PROBE_TEMP_SHIFT + i * 2, &z_shift);
|
|
|
|
|
|
- }
|
|
|
- lcd_temp_cal_show_result(true);
|
|
|
+ }
|
|
|
+ lcd_temp_cal_show_result(true);
|
|
|
|
|
|
- break;
|
|
|
- }
|
|
|
-#endif //PINDA_THERMISTOR
|
|
|
+#else //PINDA_THERMISTOR
|
|
|
|
|
|
setTargetBed(PINDA_MIN_T);
|
|
|
float zero_z;
|
|
@@ -4730,7 +4937,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
// Push the commands to the front of the message queue in the reverse order!
|
|
|
// There shall be always enough space reserved for these commands.
|
|
|
repeatcommand_front(); // repeat G76 with all its parameters
|
|
|
- enquecommand_front_P((PSTR("G28 W0")));
|
|
|
+ enquecommand_front_P(G28W0);
|
|
|
break;
|
|
|
}
|
|
|
puts_P(_N("PINDA probe calibration start"));
|
|
@@ -4740,7 +4947,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
st_synchronize();
|
|
|
|
|
|
while (abs(degBed() - PINDA_MIN_T) > 1) {
|
|
@@ -4756,11 +4963,11 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0); //invalidate temp. calibration in case that in will be aborted during the calibration process
|
|
|
|
|
|
current_position[Z_AXIS] = 5;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
|
|
|
current_position[X_AXIS] = BED_X0;
|
|
|
current_position[Y_AXIS] = BED_Y0;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
st_synchronize();
|
|
|
|
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
@@ -4777,7 +4984,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
current_position[X_AXIS] = PINDA_PREHEAT_X;
|
|
|
current_position[Y_AXIS] = PINDA_PREHEAT_Y;
|
|
|
current_position[Z_AXIS] = PINDA_PREHEAT_Z;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
st_synchronize();
|
|
|
while (degBed() < t_c) {
|
|
|
delay_keep_alive(1000);
|
|
@@ -4788,10 +4995,10 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
serialecho_temperatures();
|
|
|
}
|
|
|
current_position[Z_AXIS] = 5;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
current_position[X_AXIS] = BED_X0;
|
|
|
current_position[Y_AXIS] = BED_Y0;
|
|
|
- plan_buffer_line_curposXYZE(3000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(3000 / 60);
|
|
|
st_synchronize();
|
|
|
find_bed_induction_sensor_point_z(-1.f);
|
|
|
z_shift = (int)((current_position[Z_AXIS] - zero_z)*cs.axis_steps_per_unit[Z_AXIS]);
|
|
@@ -4814,13 +5021,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
disable_e2();
|
|
|
setTargetBed(0); //set bed target temperature back to 0
|
|
|
lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE));
|
|
|
- temp_cal_active = true;
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1);
|
|
|
lcd_update_enable(true);
|
|
|
lcd_update(2);
|
|
|
|
|
|
|
|
|
-
|
|
|
+#endif //PINDA_THERMISTOR
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -4862,11 +5068,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
case_G80:
|
|
|
{
|
|
|
mesh_bed_leveling_flag = true;
|
|
|
-#ifndef LA_NOCOMPAT
|
|
|
- // When printing via USB there's no clear boundary between prints. Abuse MBL to indicate
|
|
|
- // the beginning of a new print, allowing a new autodetected setting just after G80.
|
|
|
- la10c_reset();
|
|
|
-#endif
|
|
|
#ifndef PINDA_THERMISTOR
|
|
|
static bool run = false; // thermistor-less PINDA temperature compensation is running
|
|
|
#endif // ndef PINDA_THERMISTOR
|
|
@@ -4885,7 +5086,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
// Push the commands to the front of the message queue in the reverse order!
|
|
|
// There shall be always enough space reserved for these commands.
|
|
|
repeatcommand_front(); // repeat G80 with all its parameters
|
|
|
- enquecommand_front_P((PSTR("G28 W0")));
|
|
|
+ enquecommand_front_P(G28W0);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -4918,7 +5119,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
temp_compensation_start();
|
|
|
run = true;
|
|
|
repeatcommand_front(); // repeat G80 with all its parameters
|
|
|
- enquecommand_front_P((PSTR("G28 W0")));
|
|
|
+ enquecommand_front_P(G28W0);
|
|
|
break;
|
|
|
}
|
|
|
run = false;
|
|
@@ -4939,7 +5140,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
// Cycle through all points and probe them
|
|
|
// First move up. During this first movement, the babystepping will be reverted.
|
|
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
|
|
// The move to the first calibration point.
|
|
|
current_position[X_AXIS] = BED_X0;
|
|
|
current_position[Y_AXIS] = BED_Y0;
|
|
@@ -4954,7 +5155,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
|
|
#endif //SUPPORT_VERBOSITY
|
|
|
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[X_AXIS] / 30, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[X_AXIS] / 30);
|
|
|
// Wait until the move is finished.
|
|
|
st_synchronize();
|
|
|
|
|
@@ -4969,7 +5170,6 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
}
|
|
|
#endif // SUPPORT_VERBOSITY
|
|
|
int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100
|
|
|
- const char *kill_message = NULL;
|
|
|
while (mesh_point != nMeasPoints * nMeasPoints) {
|
|
|
// Get coords of a measuring point.
|
|
|
uint8_t ix = mesh_point % nMeasPoints; // from 0 to MESH_NUM_X_POINTS - 1
|
|
@@ -5006,7 +5206,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
if((ix == 0) && (iy == 0)) current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
else current_position[Z_AXIS] += 2.f / nMeasPoints; //use relative movement from Z coordinate where PINDa triggered on previous point. This makes calibration faster.
|
|
|
float init_z_bckp = current_position[Z_AXIS];
|
|
|
- plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
|
|
st_synchronize();
|
|
|
|
|
|
// Move to XY position of the sensor point.
|
|
@@ -5027,7 +5227,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
#endif // SUPPORT_VERBOSITY
|
|
|
|
|
|
//printf_P(PSTR("after clamping: [%f;%f]\n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
|
|
- plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE);
|
|
|
st_synchronize();
|
|
|
|
|
|
// Go down until endstop is hit
|
|
@@ -5039,7 +5239,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
if (init_z_bckp - current_position[Z_AXIS] < 0.1f) { //broken cable or initial Z coordinate too low. Go to MESH_HOME_Z_SEARCH and repeat last step (z-probe) again to distinguish between these two cases.
|
|
|
//printf_P(PSTR("Another attempt! Current Z position: %f\n"), current_position[Z_AXIS]);
|
|
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
|
|
st_synchronize();
|
|
|
|
|
|
if (!find_bed_induction_sensor_point_z((has_z && mesh_point > 0) ? z0 - Z_CALIBRATION_THRESHOLD : -10.f, nProbeRetry)) { //if we have data from z calibration max allowed difference is 1mm for each point, if we dont have data max difference is 10mm from initial point
|
|
@@ -5047,12 +5247,12 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
break;
|
|
|
}
|
|
|
if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) {
|
|
|
- printf_P(PSTR("Bed leveling failed. Sensor disconnected or cable broken.\n"));
|
|
|
+ puts_P(PSTR("Bed leveling failed. Sensor disconnected or cable broken."));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point
|
|
|
- printf_P(PSTR("Bed leveling failed. Sensor triggered too high.\n"));
|
|
|
+ puts_P(PSTR("Bed leveling failed. Sensor triggered too high."));
|
|
|
break;
|
|
|
}
|
|
|
#ifdef SUPPORT_VERBOSITY
|
|
@@ -5094,7 +5294,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
MYSERIAL.print(current_position[Z_AXIS], 5);
|
|
|
}
|
|
|
#endif // SUPPORT_VERBOSITY
|
|
|
- plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
|
|
st_synchronize();
|
|
|
if (mesh_point != nMeasPoints * nMeasPoints) {
|
|
|
Sound_MakeSound(e_SOUND_TYPE_StandardAlert);
|
|
@@ -5111,14 +5311,14 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
// ~ Z-homing (can not be used "G28", because X & Y-homing would have been done before (Z-homing))
|
|
|
bState=enable_z_endstop(false);
|
|
|
current_position[Z_AXIS] -= 1;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
enable_z_endstop(true);
|
|
|
#ifdef TMC2130
|
|
|
tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
#endif // TMC2130
|
|
|
current_position[Z_AXIS] = MESH_HOME_Z_SEARCH;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
tmc2130_home_exit();
|
|
@@ -5246,9 +5446,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
go_home_with_z_lift();
|
|
|
// SERIAL_ECHOLNPGM("Go home finished");
|
|
|
//unretract (after PINDA preheat retraction)
|
|
|
- if (degHotend(active_extruder) > EXTRUDE_MINTEMP && temp_cal_active == true && calibration_status_pinda() == true && target_temperature_bed >= 50) {
|
|
|
+ if ((degHotend(active_extruder) > EXTRUDE_MINTEMP) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) {
|
|
|
current_position[E_AXIS] += default_retraction;
|
|
|
- plan_buffer_line_curposXYZE(400, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(400);
|
|
|
}
|
|
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
|
// Restore custom message state
|
|
@@ -5270,7 +5470,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
if (mbl.active) {
|
|
|
SERIAL_PROTOCOLPGM("Num X,Y: ");
|
|
|
SERIAL_PROTOCOL(MESH_NUM_X_POINTS);
|
|
|
- SERIAL_PROTOCOLPGM(",");
|
|
|
+ SERIAL_PROTOCOL(',');
|
|
|
SERIAL_PROTOCOL(MESH_NUM_Y_POINTS);
|
|
|
SERIAL_PROTOCOLPGM("\nZ search height: ");
|
|
|
SERIAL_PROTOCOL(MESH_HOME_Z_SEARCH);
|
|
@@ -5280,7 +5480,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
SERIAL_PROTOCOLPGM(" ");
|
|
|
SERIAL_PROTOCOL_F(mbl.z_values[y][x], 5);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLPGM("\n");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -5435,10 +5635,9 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
farm_mode = 1;
|
|
|
PingTime = _millis();
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_FARM_MODE, farm_mode);
|
|
|
- EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no);
|
|
|
- SilentModeMenu = SILENT_MODE_OFF;
|
|
|
- eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
|
|
|
- fCheckModeInit(); // alternatively invoke printer reset
|
|
|
+ SilentModeMenu = SILENT_MODE_OFF;
|
|
|
+ eeprom_update_byte((unsigned char *)EEPROM_SILENT, SilentModeMenu);
|
|
|
+ fCheckModeInit(); // alternatively invoke printer reset
|
|
|
break;
|
|
|
|
|
|
/*! ### G99 - Deactivate farm mode <a href="https://reprap.org/wiki/G-code#G99:_Deactivate_farm_mode">G99: Deactivate farm mode</a>
|
|
@@ -5553,10 +5752,16 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
/*!
|
|
|
### M20 - SD Card file list <a href="https://reprap.org/wiki/G-code#M20:_List_SD_card">M20: List SD card</a>
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M20 [ L ]
|
|
|
+ #### Parameters
|
|
|
+ - `L` - Reports ling filenames instead of just short filenames. Requires host software parsing.
|
|
|
*/
|
|
|
case 20:
|
|
|
+ KEEPALIVE_STATE(NOT_BUSY); // do not send busy messages during listing. Inhibits the output of manage_heater()
|
|
|
SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST
|
|
|
- card.ls();
|
|
|
+ card.ls(code_seen('L'));
|
|
|
SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST
|
|
|
break;
|
|
|
|
|
@@ -5634,9 +5839,15 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
/*!
|
|
|
### M27 - Get SD status <a href="https://reprap.org/wiki/G-code#M27:_Report_SD_print_status">M27: Report SD print status</a>
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M27 [ P ]
|
|
|
+
|
|
|
+ #### Parameters
|
|
|
+ - `P` - Show full SFN path instead of LFN only.
|
|
|
*/
|
|
|
case 27:
|
|
|
- card.getStatus();
|
|
|
+ card.getStatus(code_seen('P'));
|
|
|
break;
|
|
|
|
|
|
/*!
|
|
@@ -5853,28 +6064,29 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
/*!
|
|
|
### M46 - Show the assigned IP address <a href="https://reprap.org/wiki/G-code#M46:_Show_the_assigned_IP_address">M46: Show the assigned IP address.</a>
|
|
|
*/
|
|
|
- /*
|
|
|
- case 46:
|
|
|
+ case 46:
|
|
|
{
|
|
|
// M46: Prusa3D: Show the assigned IP address.
|
|
|
- uint8_t ip[4];
|
|
|
- bool hasIP = card.ToshibaFlashAir_GetIP(ip);
|
|
|
- if (hasIP) {
|
|
|
- SERIAL_ECHOPGM("Toshiba FlashAir current IP: ");
|
|
|
- SERIAL_ECHO(int(ip[0]));
|
|
|
- SERIAL_ECHOPGM(".");
|
|
|
- SERIAL_ECHO(int(ip[1]));
|
|
|
- SERIAL_ECHOPGM(".");
|
|
|
- SERIAL_ECHO(int(ip[2]));
|
|
|
- SERIAL_ECHOPGM(".");
|
|
|
- SERIAL_ECHO(int(ip[3]));
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
+ if (card.ToshibaFlashAir_isEnabled()) {
|
|
|
+ uint8_t ip[4];
|
|
|
+ if (card.ToshibaFlashAir_GetIP(ip)) {
|
|
|
+ // SERIAL_PROTOCOLPGM("Toshiba FlashAir current IP: ");
|
|
|
+ SERIAL_PROTOCOL(uint8_t(ip[0]));
|
|
|
+ SERIAL_PROTOCOL('.');
|
|
|
+ SERIAL_PROTOCOL(uint8_t(ip[1]));
|
|
|
+ SERIAL_PROTOCOL('.');
|
|
|
+ SERIAL_PROTOCOL(uint8_t(ip[2]));
|
|
|
+ SERIAL_PROTOCOL('.');
|
|
|
+ SERIAL_PROTOCOL(uint8_t(ip[3]));
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
+ } else {
|
|
|
+ SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n");
|
|
|
+ }
|
|
|
} else {
|
|
|
- SERIAL_ECHOLNPGM("Toshiba FlashAir GetIP failed");
|
|
|
+ SERIAL_PROTOCOLLNPGM("n/a");
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
- */
|
|
|
|
|
|
/*!
|
|
|
### M47 - Show end stops dialog on the display <a href="https://reprap.org/wiki/G-code#M47:_Show_end_stops_dialog_on_the_display">M47: Show end stops dialog on the display</a>
|
|
@@ -6273,96 +6485,53 @@ Sigma_Exit:
|
|
|
uint8_t extruder;
|
|
|
if(setTargetedHotend(105, extruder)){
|
|
|
break;
|
|
|
- }
|
|
|
- #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1
|
|
|
- SERIAL_PROTOCOLPGM("ok T:");
|
|
|
- SERIAL_PROTOCOL_F(degHotend(extruder),1);
|
|
|
- SERIAL_PROTOCOLPGM(" /");
|
|
|
- SERIAL_PROTOCOL_F(degTargetHotend(extruder),1);
|
|
|
- #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
- SERIAL_PROTOCOLPGM(" B:");
|
|
|
- SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
- SERIAL_PROTOCOLPGM(" /");
|
|
|
- SERIAL_PROTOCOL_F(degTargetBed(),1);
|
|
|
- #endif //TEMP_BED_PIN
|
|
|
- for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
|
|
- SERIAL_PROTOCOLPGM(" T");
|
|
|
- SERIAL_PROTOCOL(cur_extruder);
|
|
|
- SERIAL_PROTOCOLPGM(":");
|
|
|
- SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
|
|
- SERIAL_PROTOCOLPGM(" /");
|
|
|
- SERIAL_PROTOCOL_F(degTargetHotend(cur_extruder),1);
|
|
|
- }
|
|
|
- #else
|
|
|
- SERIAL_ERROR_START;
|
|
|
- SERIAL_ERRORLNRPGM(_i("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS
|
|
|
- #endif
|
|
|
-
|
|
|
- SERIAL_PROTOCOLPGM(" @:");
|
|
|
- #ifdef EXTRUDER_WATTS
|
|
|
- SERIAL_PROTOCOL((EXTRUDER_WATTS * getHeaterPower(tmp_extruder))/127);
|
|
|
- SERIAL_PROTOCOLPGM("W");
|
|
|
- #else
|
|
|
- SERIAL_PROTOCOL(getHeaterPower(extruder));
|
|
|
- #endif
|
|
|
-
|
|
|
- SERIAL_PROTOCOLPGM(" B@:");
|
|
|
- #ifdef BED_WATTS
|
|
|
- SERIAL_PROTOCOL((BED_WATTS * getHeaterPower(-1))/127);
|
|
|
- SERIAL_PROTOCOLPGM("W");
|
|
|
- #else
|
|
|
- SERIAL_PROTOCOL(getHeaterPower(-1));
|
|
|
- #endif
|
|
|
-
|
|
|
-#ifdef PINDA_THERMISTOR
|
|
|
- SERIAL_PROTOCOLPGM(" P:");
|
|
|
- SERIAL_PROTOCOL_F(current_temperature_pinda,1);
|
|
|
-#endif //PINDA_THERMISTOR
|
|
|
-
|
|
|
-#ifdef AMBIENT_THERMISTOR
|
|
|
- SERIAL_PROTOCOLPGM(" A:");
|
|
|
- SERIAL_PROTOCOL_F(current_temperature_ambient,1);
|
|
|
-#endif //AMBIENT_THERMISTOR
|
|
|
-
|
|
|
-
|
|
|
- #ifdef SHOW_TEMP_ADC_VALUES
|
|
|
- {float raw = 0.0;
|
|
|
-
|
|
|
- #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
|
|
|
- SERIAL_PROTOCOLPGM(" ADC B:");
|
|
|
- SERIAL_PROTOCOL_F(degBed(),1);
|
|
|
- SERIAL_PROTOCOLPGM("C->");
|
|
|
- raw = rawBedTemp();
|
|
|
- SERIAL_PROTOCOL_F(raw/OVERSAMPLENR,5);
|
|
|
- SERIAL_PROTOCOLPGM(" Rb->");
|
|
|
- SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5);
|
|
|
- SERIAL_PROTOCOLPGM(" Rxb->");
|
|
|
- SERIAL_PROTOCOL_F(raw, 5);
|
|
|
- #endif
|
|
|
- for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
|
|
|
- SERIAL_PROTOCOLPGM(" T");
|
|
|
- SERIAL_PROTOCOL(cur_extruder);
|
|
|
- SERIAL_PROTOCOLPGM(":");
|
|
|
- SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
|
|
|
- SERIAL_PROTOCOLPGM("C->");
|
|
|
- raw = rawHotendTemp(cur_extruder);
|
|
|
- SERIAL_PROTOCOL_F(raw/OVERSAMPLENR,5);
|
|
|
- SERIAL_PROTOCOLPGM(" Rt");
|
|
|
- SERIAL_PROTOCOL(cur_extruder);
|
|
|
- SERIAL_PROTOCOLPGM("->");
|
|
|
- SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5);
|
|
|
- SERIAL_PROTOCOLPGM(" Rx");
|
|
|
- SERIAL_PROTOCOL(cur_extruder);
|
|
|
- SERIAL_PROTOCOLPGM("->");
|
|
|
- SERIAL_PROTOCOL_F(raw, 5);
|
|
|
- }}
|
|
|
- #endif
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
- KEEPALIVE_STATE(NOT_BUSY);
|
|
|
- return;
|
|
|
+ }
|
|
|
+
|
|
|
+ SERIAL_PROTOCOLPGM("ok ");
|
|
|
+ gcode_M105(extruder);
|
|
|
+
|
|
|
+ cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning.
|
|
|
+
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+#if defined(AUTO_REPORT)
|
|
|
+ /*!
|
|
|
+ ### M155 - Automatically send status <a href="https://reprap.org/wiki/G-code#M155:_Automatically_send_temperatures">M155: Automatically send temperatures</a>
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M155 [ S ] [ C ]
|
|
|
+
|
|
|
+ #### Parameters
|
|
|
+
|
|
|
+ - `S` - Set autoreporting interval in seconds. 0 to disable. Maximum: 255
|
|
|
+ - `C` - Activate auto-report function (bit mask). Default is temperature.
|
|
|
+
|
|
|
+ bit 0 = Auto-report temperatures
|
|
|
+ bit 1 = Auto-report fans
|
|
|
+ bit 2 = Auto-report position
|
|
|
+ bit 3 = free
|
|
|
+ bit 4 = free
|
|
|
+ bit 5 = free
|
|
|
+ bit 6 = free
|
|
|
+ bit 7 = free
|
|
|
+ */
|
|
|
+ //!@todo update RepRap Gcode wiki
|
|
|
+ //!@todo Should be temperature always? Octoprint doesn't switch to M105 if M155 timer is set
|
|
|
+ case 155:
|
|
|
+ {
|
|
|
+ if (code_seen('S')){
|
|
|
+ autoReportFeatures.SetPeriod( code_value_uint8() );
|
|
|
+ }
|
|
|
+ if (code_seen('C')){
|
|
|
+ autoReportFeatures.SetMask(code_value());
|
|
|
+ } else{
|
|
|
+ autoReportFeatures.SetMask(1); //Backwards compability to host systems like Octoprint to send only temp if paramerter `C`isn't used.
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
+#endif //AUTO_REPORT
|
|
|
+
|
|
|
/*!
|
|
|
### M109 - Wait for extruder temperature <a href="https://reprap.org/wiki/G-code#M109:_Set_Extruder_Temperature_and_Wait">M109: Set Extruder Temperature and Wait</a>
|
|
|
#### Usage
|
|
@@ -6475,7 +6644,7 @@ Sigma_Exit:
|
|
|
SERIAL_PROTOCOL((int)active_extruder);
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
SERIAL_PROTOCOL_F(degBed(), 1);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
codenum = _millis();
|
|
|
|
|
@@ -6745,7 +6914,7 @@ Sigma_Exit:
|
|
|
else {
|
|
|
SERIAL_ECHO_START;
|
|
|
SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -6795,6 +6964,9 @@ Sigma_Exit:
|
|
|
SERIAL_ECHOPGM(STRINGIFY(EXTRUDERS));
|
|
|
SERIAL_ECHOPGM(" UUID:");
|
|
|
SERIAL_ECHOLNPGM(MACHINE_UUID);
|
|
|
+#ifdef EXTENDED_CAPABILITIES_REPORT
|
|
|
+ extended_capabilities_report();
|
|
|
+#endif //EXTENDED_CAPABILITIES_REPORT
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -6820,14 +6992,14 @@ Sigma_Exit:
|
|
|
### M120 - Enable endstops <a href="https://reprap.org/wiki/G-code#M120:_Enable_endstop_detection">M120: Enable endstop detection</a>
|
|
|
*/
|
|
|
case 120:
|
|
|
- enable_endstops(false) ;
|
|
|
+ enable_endstops(true) ;
|
|
|
break;
|
|
|
|
|
|
/*!
|
|
|
### M121 - Disable endstops <a href="https://reprap.org/wiki/G-code#M121:_Disable_endstop_detection">M121: Disable endstop detection</a>
|
|
|
*/
|
|
|
case 121:
|
|
|
- enable_endstops(true) ;
|
|
|
+ enable_endstops(false) ;
|
|
|
break;
|
|
|
|
|
|
/*!
|
|
@@ -6836,7 +7008,7 @@ Sigma_Exit:
|
|
|
*/
|
|
|
case 119:
|
|
|
SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#if defined(X_MIN_PIN) && X_MIN_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN
|
|
|
if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){
|
|
@@ -6844,7 +7016,7 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
#if defined(X_MAX_PIN) && X_MAX_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX
|
|
@@ -6853,7 +7025,7 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
#if defined(Y_MIN_PIN) && Y_MIN_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN
|
|
@@ -6862,7 +7034,7 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
#if defined(Y_MAX_PIN) && Y_MAX_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX
|
|
@@ -6871,7 +7043,7 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
#if defined(Z_MIN_PIN) && Z_MIN_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(MSG_Z_MIN);
|
|
@@ -6880,7 +7052,7 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
#if defined(Z_MAX_PIN) && Z_MAX_PIN > -1
|
|
|
SERIAL_PROTOCOLRPGM(MSG_Z_MAX);
|
|
@@ -6889,11 +7061,34 @@ Sigma_Exit:
|
|
|
}else{
|
|
|
SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN);
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
break;
|
|
|
//!@todo update for all axes, use for loop
|
|
|
+
|
|
|
+#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
|
|
+ /*!
|
|
|
+ ### M123 - Tachometer value <a href="https://www.reprap.org/wiki/G-code#M123:_Tachometer_value_.28RepRap.29">M123: Tachometer value</a>
|
|
|
+ This command is used to report fan speeds and fan pwm values.
|
|
|
+ #### Usage
|
|
|
|
|
|
+ M123
|
|
|
+
|
|
|
+ - E0: - Hotend fan speed in RPM
|
|
|
+ - PRN1: - Part cooling fans speed in RPM
|
|
|
+ - E0@: - Hotend fan PWM value
|
|
|
+ - PRN1@: -Part cooling fan PWM value
|
|
|
+
|
|
|
+ _Example:_
|
|
|
+
|
|
|
+ E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255
|
|
|
+
|
|
|
+ */
|
|
|
+ //!@todo Update RepRap Gcode wiki
|
|
|
+ case 123:
|
|
|
+ gcode_M123();
|
|
|
+ break;
|
|
|
+#endif //FANCHECK and TACH_0 and TACH_1
|
|
|
|
|
|
#ifdef BLINKM
|
|
|
/*!
|
|
@@ -7014,7 +7209,7 @@ Sigma_Exit:
|
|
|
For each axis individually.
|
|
|
*/
|
|
|
case 203: // M203 max feedrate mm/sec
|
|
|
- for (int8_t i = 0; i < NUM_AXIS; i++)
|
|
|
+ for (uint8_t i = 0; i < NUM_AXIS; i++)
|
|
|
{
|
|
|
if (code_seen(axis_codes[i]))
|
|
|
{
|
|
@@ -7065,7 +7260,7 @@ Sigma_Exit:
|
|
|
// Legacy acceleration format. This format is used by the legacy Marlin, MK2 or MK3 firmware,
|
|
|
// and it is also generated by Slic3r to control acceleration per extrusion type
|
|
|
// (there is a separate acceleration settings in Slicer for perimeter, first layer etc).
|
|
|
- cs.acceleration = code_value();
|
|
|
+ cs.acceleration = cs.travel_acceleration = code_value();
|
|
|
// Interpret the T value as retract acceleration in the old Marlin format.
|
|
|
if(code_seen('T'))
|
|
|
cs.retract_acceleration = code_value();
|
|
@@ -7075,13 +7270,8 @@ Sigma_Exit:
|
|
|
cs.acceleration = code_value();
|
|
|
if(code_seen('R'))
|
|
|
cs.retract_acceleration = code_value();
|
|
|
- if(code_seen('T')) {
|
|
|
- // Interpret the T value as the travel acceleration in the new Marlin format.
|
|
|
- /*!
|
|
|
- @todo Prusa3D firmware currently does not support travel acceleration value independent from the extruding acceleration value.
|
|
|
- */
|
|
|
- // travel_acceleration = code_value();
|
|
|
- }
|
|
|
+ if(code_seen('T'))
|
|
|
+ cs.travel_acceleration = code_value();
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -7114,7 +7304,6 @@ Sigma_Exit:
|
|
|
{
|
|
|
float e = code_value();
|
|
|
#ifndef LA_NOCOMPAT
|
|
|
-
|
|
|
e = la10c_jerk(e);
|
|
|
#endif
|
|
|
cs.max_jerk[E_AXIS] = e;
|
|
@@ -7136,7 +7325,7 @@ Sigma_Exit:
|
|
|
- `Z` - Z axis offset
|
|
|
*/
|
|
|
case 206:
|
|
|
- for(int8_t i=0; i < 3; i++)
|
|
|
+ for(uint8_t i=0; i < 3; i++)
|
|
|
{
|
|
|
if(code_seen(axis_codes[i])) cs.add_homing[i] = code_value();
|
|
|
}
|
|
@@ -7294,17 +7483,26 @@ Sigma_Exit:
|
|
|
*/
|
|
|
case 220: // M220 S<factor in percent>- set speed factor override percentage
|
|
|
{
|
|
|
- if (code_seen('B')) //backup current speed factor
|
|
|
- {
|
|
|
- saved_feedmultiply_mm = feedmultiply;
|
|
|
- }
|
|
|
- if(code_seen('S'))
|
|
|
- {
|
|
|
- feedmultiply = code_value() ;
|
|
|
- }
|
|
|
- if (code_seen('R')) { //restore previous feedmultiply
|
|
|
- feedmultiply = saved_feedmultiply_mm;
|
|
|
- }
|
|
|
+ bool codesWereSeen = false;
|
|
|
+ if (code_seen('B')) //backup current speed factor
|
|
|
+ {
|
|
|
+ saved_feedmultiply_mm = feedmultiply;
|
|
|
+ codesWereSeen = true;
|
|
|
+ }
|
|
|
+ if (code_seen('S'))
|
|
|
+ {
|
|
|
+ feedmultiply = code_value();
|
|
|
+ codesWereSeen = true;
|
|
|
+ }
|
|
|
+ if (code_seen('R')) //restore previous feedmultiply
|
|
|
+ {
|
|
|
+ feedmultiply = saved_feedmultiply_mm;
|
|
|
+ codesWereSeen = true;
|
|
|
+ }
|
|
|
+ if (!codesWereSeen)
|
|
|
+ {
|
|
|
+ printf_P(PSTR("%i%%\n"), feedmultiply);
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -7320,23 +7518,26 @@ Sigma_Exit:
|
|
|
*/
|
|
|
case 221: // M221 S<factor in percent>- set extrude factor override percentage
|
|
|
{
|
|
|
- if(code_seen('S'))
|
|
|
- {
|
|
|
- int tmp_code = code_value();
|
|
|
- if (code_seen('T'))
|
|
|
+ if (code_seen('S'))
|
|
|
{
|
|
|
- uint8_t extruder;
|
|
|
- if(setTargetedHotend(221, extruder)){
|
|
|
- break;
|
|
|
- }
|
|
|
- extruder_multiply[extruder] = tmp_code;
|
|
|
+ int tmp_code = code_value();
|
|
|
+ if (code_seen('T'))
|
|
|
+ {
|
|
|
+ uint8_t extruder;
|
|
|
+ if (setTargetedHotend(221, extruder))
|
|
|
+ break;
|
|
|
+ extruder_multiply[extruder] = tmp_code;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ extrudemultiply = tmp_code ;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- extrudemultiply = tmp_code ;
|
|
|
+ printf_P(PSTR("%i%%\n"), extrudemultiply);
|
|
|
}
|
|
|
- }
|
|
|
- calculate_extruder_multipliers();
|
|
|
+ calculate_extruder_multipliers();
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -7447,7 +7648,7 @@ Sigma_Exit:
|
|
|
SERIAL_PROTOCOL(servo_index);
|
|
|
SERIAL_PROTOCOL(": ");
|
|
|
SERIAL_PROTOCOL(servos[servo_index].read());
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -7523,7 +7724,7 @@ Sigma_Exit:
|
|
|
//Kc does not have scaling applied above, or in resetting defaults
|
|
|
SERIAL_PROTOCOL(Kc);
|
|
|
#endif
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
break;
|
|
|
#endif //PIDTEMP
|
|
@@ -7556,7 +7757,7 @@ Sigma_Exit:
|
|
|
SERIAL_PROTOCOL(unscalePID_i(cs.bedKi));
|
|
|
SERIAL_PROTOCOL(" d:");
|
|
|
SERIAL_PROTOCOL(unscalePID_d(cs.bedKd));
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
break;
|
|
|
#endif //PIDTEMP
|
|
@@ -7779,7 +7980,7 @@ Sigma_Exit:
|
|
|
cs.zprobe_zoffset = -value; // compare w/ line 278 of ConfigurationStore.cpp
|
|
|
SERIAL_ECHO_START;
|
|
|
SERIAL_ECHOLNRPGM(CAT4(MSG_ZPROBE_ZOFFSET, " ", MSG_OK,PSTR("")));
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -7789,7 +7990,7 @@ Sigma_Exit:
|
|
|
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
|
|
|
SERIAL_ECHORPGM(MSG_Z_MAX);
|
|
|
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -7797,12 +7998,42 @@ Sigma_Exit:
|
|
|
SERIAL_ECHO_START;
|
|
|
SERIAL_ECHOLNRPGM(CAT2(MSG_ZPROBE_ZOFFSET, PSTR(" : ")));
|
|
|
SERIAL_ECHO(-cs.zprobe_zoffset);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
#endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
|
|
|
|
|
|
+ /*!
|
|
|
+ ### M552 - Set IP address <a href="https://reprap.org/wiki/G-code#M552:_Set_IP_address.2C_enable.2Fdisable_network_interface">M552: Set IP address, enable/disable network interface"</a>
|
|
|
+ Sets the printer IP address that is shown in the support menu. Designed to be used with the help of host software.
|
|
|
+ If P is not specified nothing happens.
|
|
|
+ If the structure of the IP address is invalid, 0.0.0.0 is assumed and nothing is shown on the screen in the Support menu.
|
|
|
+ #### Usage
|
|
|
+
|
|
|
+ M552 [ P<IP_address> ]
|
|
|
+
|
|
|
+ #### Parameters
|
|
|
+ - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14
|
|
|
+ */
|
|
|
+ case 552:
|
|
|
+ {
|
|
|
+ if (code_seen('P'))
|
|
|
+ {
|
|
|
+ uint8_t valCnt = 0;
|
|
|
+ IP_address = 0;
|
|
|
+ do
|
|
|
+ {
|
|
|
+ *strchr_pointer = '*';
|
|
|
+ ((uint8_t*)&IP_address)[valCnt] = code_value_short();
|
|
|
+ valCnt++;
|
|
|
+ } while ((valCnt < 4) && code_seen('.'));
|
|
|
+
|
|
|
+ if (valCnt != 4)
|
|
|
+ IP_address = 0;
|
|
|
+ }
|
|
|
+ } break;
|
|
|
+
|
|
|
#ifdef FILAMENTCHANGEENABLE
|
|
|
|
|
|
/*!
|
|
@@ -7886,7 +8117,7 @@ Sigma_Exit:
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
- if (mmu_enabled && code_seen("AUTO"))
|
|
|
+ if (mmu_enabled && code_seen_P(PSTR("AUTO")))
|
|
|
automatic = true;
|
|
|
|
|
|
gcode_M600(automatic, x_position, y_position, z_shift, e_shift_init, e_shift_late);
|
|
@@ -7910,6 +8141,7 @@ Sigma_Exit:
|
|
|
if (!isPrintPaused)
|
|
|
{
|
|
|
st_synchronize();
|
|
|
+ ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front();
|
|
|
cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore
|
|
|
lcd_pause_print();
|
|
|
}
|
|
@@ -7959,7 +8191,7 @@ Sigma_Exit:
|
|
|
|
|
|
SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:");
|
|
|
SERIAL_PROTOCOL(set_target_pinda);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
|
|
|
codenum = _millis();
|
|
|
cancel_heatup = false;
|
|
@@ -7974,9 +8206,8 @@ Sigma_Exit:
|
|
|
{
|
|
|
SERIAL_PROTOCOLPGM("P:");
|
|
|
SERIAL_PROTOCOL_F(current_temperature_pinda, 1);
|
|
|
- SERIAL_PROTOCOLPGM("/");
|
|
|
- SERIAL_PROTOCOL(set_target_pinda);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOL('/');
|
|
|
+ SERIAL_PROTOCOLLN(set_target_pinda);
|
|
|
codenum = _millis();
|
|
|
}
|
|
|
manage_heater();
|
|
@@ -8019,7 +8250,7 @@ Sigma_Exit:
|
|
|
SERIAL_PROTOCOL(usteps);
|
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
|
SERIAL_PROTOCOL(mm * 1000);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
}
|
|
|
else if (code_seen('!')) { // ! - Set factory default values
|
|
@@ -8062,7 +8293,7 @@ Sigma_Exit:
|
|
|
SERIAL_PROTOCOL(usteps);
|
|
|
SERIAL_PROTOCOLPGM(", ");
|
|
|
SERIAL_PROTOCOL(mm * 1000);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -8153,7 +8384,7 @@ Sigma_Exit:
|
|
|
if(code_seen('P'))
|
|
|
fw_version_check(++strchr_pointer);
|
|
|
else if(code_seen('Q'))
|
|
|
- SERIAL_PROTOCOLLN(FW_VERSION);
|
|
|
+ SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P());
|
|
|
break;
|
|
|
case ClPrintChecking::_Gcode: // ~ .5
|
|
|
if(code_seen('P'))
|
|
@@ -8565,7 +8796,7 @@ Sigma_Exit:
|
|
|
break;
|
|
|
|
|
|
/*!
|
|
|
- ### M999 - Restart after being stopped <a href="https://reprap.org/wiki/G-code#M999:_Restart_after_being_stopped_by_error">M999: Restart after being stopped by error</a>
|
|
|
+ ### M999 - Restart after being stopped <a href="https://reprap.org/wiki/G-code#M999:_Restart_after_being_stopped_by_error">M999: Restart after being stopped by error</a>
|
|
|
@todo Usually doesn't work. Should be fixed or removed. Most of the time, if `Stopped` it set, the print fails and is unrecoverable.
|
|
|
*/
|
|
|
case 999:
|
|
@@ -8597,6 +8828,8 @@ Sigma_Exit:
|
|
|
*/
|
|
|
else if(code_seen('T'))
|
|
|
{
|
|
|
+ static const char duplicate_Tcode_ignored[] PROGMEM = "Duplicate T-code ignored.";
|
|
|
+
|
|
|
int index;
|
|
|
bool load_to_nozzle = false;
|
|
|
for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++);
|
|
@@ -8612,7 +8845,7 @@ Sigma_Exit:
|
|
|
tmp_extruder = choose_menu_P(_T(MSG_CHOOSE_FILAMENT), _T(MSG_FILAMENT));
|
|
|
if ((tmp_extruder == mmu_extruder) && mmu_fil_loaded) //dont execute the same T-code twice in a row
|
|
|
{
|
|
|
- printf_P(PSTR("Duplicate T-code ignored.\n"));
|
|
|
+ puts_P(duplicate_Tcode_ignored);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -8657,7 +8890,7 @@ Sigma_Exit:
|
|
|
{
|
|
|
if ((tmp_extruder == mmu_extruder) && mmu_fil_loaded) //dont execute the same T-code twice in a row
|
|
|
{
|
|
|
- printf_P(PSTR("Duplicate T-code ignored.\n"));
|
|
|
+ puts_P(duplicate_Tcode_ignored);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -8725,7 +8958,7 @@ Sigma_Exit:
|
|
|
#else //SNMM
|
|
|
if (tmp_extruder >= EXTRUDERS) {
|
|
|
SERIAL_ECHO_START;
|
|
|
- SERIAL_ECHOPGM("T");
|
|
|
+ SERIAL_ECHO('T');
|
|
|
SERIAL_PROTOCOLLN((int)tmp_extruder);
|
|
|
SERIAL_ECHOLNRPGM(_n("Invalid extruder"));////MSG_INVALID_EXTRUDER
|
|
|
}
|
|
@@ -8755,7 +8988,7 @@ Sigma_Exit:
|
|
|
}
|
|
|
// Set the new active extruder and position
|
|
|
active_extruder = tmp_extruder;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
// Move to the old position if 'F' was in the parameters
|
|
|
if (make_move && Stopped == false) {
|
|
|
prepare_move();
|
|
@@ -8899,7 +9132,6 @@ Sigma_Exit:
|
|
|
*/
|
|
|
case 5:
|
|
|
dcode_5(); break;
|
|
|
- break;
|
|
|
#endif //DEBUG_DCODE5
|
|
|
#ifdef DEBUG_DCODES
|
|
|
|
|
@@ -8982,28 +9214,7 @@ Sigma_Exit:
|
|
|
- `J` - Offset Y (default 34)
|
|
|
*/
|
|
|
case 80:
|
|
|
- {
|
|
|
- float dimension_x = 40;
|
|
|
- float dimension_y = 40;
|
|
|
- int points_x = 40;
|
|
|
- int points_y = 40;
|
|
|
- float offset_x = 74;
|
|
|
- float offset_y = 33;
|
|
|
-
|
|
|
- if (code_seen('E')) dimension_x = code_value();
|
|
|
- if (code_seen('F')) dimension_y = code_value();
|
|
|
- if (code_seen('G')) {points_x = code_value(); }
|
|
|
- if (code_seen('H')) {points_y = code_value(); }
|
|
|
- if (code_seen('I')) {offset_x = code_value(); }
|
|
|
- if (code_seen('J')) {offset_y = code_value(); }
|
|
|
- printf_P(PSTR("DIM X: %f\n"), dimension_x);
|
|
|
- printf_P(PSTR("DIM Y: %f\n"), dimension_y);
|
|
|
- printf_P(PSTR("POINTS X: %d\n"), points_x);
|
|
|
- printf_P(PSTR("POINTS Y: %d\n"), points_y);
|
|
|
- printf_P(PSTR("OFFSET X: %f\n"), offset_x);
|
|
|
- printf_P(PSTR("OFFSET Y: %f\n"), offset_y);
|
|
|
- bed_check(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y);
|
|
|
- }break;
|
|
|
+ dcode_80(); break;
|
|
|
|
|
|
/*!
|
|
|
### D81 - Bed analysis <a href="https://reprap.org/wiki/G-code#D81:_Bed_analysis">D80: Bed analysis</a>
|
|
@@ -9021,24 +9232,7 @@ Sigma_Exit:
|
|
|
- `J` - Offset Y (default 34)
|
|
|
*/
|
|
|
case 81:
|
|
|
- {
|
|
|
- float dimension_x = 40;
|
|
|
- float dimension_y = 40;
|
|
|
- int points_x = 40;
|
|
|
- int points_y = 40;
|
|
|
- float offset_x = 74;
|
|
|
- float offset_y = 33;
|
|
|
-
|
|
|
- if (code_seen('E')) dimension_x = code_value();
|
|
|
- if (code_seen('F')) dimension_y = code_value();
|
|
|
- if (code_seen("G")) { strchr_pointer+=1; points_x = code_value(); }
|
|
|
- if (code_seen("H")) { strchr_pointer+=1; points_y = code_value(); }
|
|
|
- if (code_seen("I")) { strchr_pointer+=1; offset_x = code_value(); }
|
|
|
- if (code_seen("J")) { strchr_pointer+=1; offset_y = code_value(); }
|
|
|
-
|
|
|
- bed_analysis(dimension_x,dimension_y,points_x,points_y,offset_x,offset_y);
|
|
|
-
|
|
|
- } break;
|
|
|
+ dcode_81(); break;
|
|
|
|
|
|
#endif //HEATBED_ANALYSIS
|
|
|
#ifdef DEBUG_DCODES
|
|
@@ -9047,17 +9241,7 @@ Sigma_Exit:
|
|
|
### D106 - Print measured fan speed for different pwm values <a href="https://reprap.org/wiki/G-code#D106:_Print_measured_fan_speed_for_different_pwm_values">D106: Print measured fan speed for different pwm values</a>
|
|
|
*/
|
|
|
case 106:
|
|
|
- {
|
|
|
- for (int i = 255; i > 0; i = i - 5) {
|
|
|
- fanSpeed = i;
|
|
|
- //delay_keep_alive(2000);
|
|
|
- for (int j = 0; j < 100; j++) {
|
|
|
- delay_keep_alive(100);
|
|
|
-
|
|
|
- }
|
|
|
- printf_P(_N("%d: %d\n"), i, fan_speed[1]);
|
|
|
- }
|
|
|
- }break;
|
|
|
+ dcode_106(); break;
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
/*!
|
|
@@ -9174,8 +9358,8 @@ void FlushSerialRequestResend()
|
|
|
// Execution of a command from a SD card will not be confirmed.
|
|
|
void ClearToSend()
|
|
|
{
|
|
|
- previous_millis_cmd = _millis();
|
|
|
- if ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))
|
|
|
+ previous_millis_cmd = _millis();
|
|
|
+ if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR)))
|
|
|
SERIAL_PROTOCOLLNRPGM(MSG_OK);
|
|
|
}
|
|
|
|
|
@@ -9354,13 +9538,13 @@ void prepare_move()
|
|
|
|
|
|
// Do not use feedmultiply for E or Z only moves
|
|
|
if( (current_position[X_AXIS] == destination [X_AXIS]) && (current_position[Y_AXIS] == destination [Y_AXIS])) {
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate/60);
|
|
|
}
|
|
|
else {
|
|
|
#ifdef MESH_BED_LEVELING
|
|
|
mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
|
|
|
#else
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply*(1./(60.f*100.f)), active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f)));
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -9494,51 +9678,95 @@ static void handleSafetyTimer()
|
|
|
}
|
|
|
#endif //SAFETYTIMER
|
|
|
|
|
|
-#define FS_CHECK_COUNT 15
|
|
|
+#ifdef IR_SENSOR_ANALOG
|
|
|
+#define FS_CHECK_COUNT 16
|
|
|
+/// Switching mechanism of the fsensor type.
|
|
|
+/// Called from 2 spots which have a very similar behavior
|
|
|
+/// 1: ClFsensorPCB::_Old -> ClFsensorPCB::_Rev04 and print _i("FS v0.4 or newer")
|
|
|
+/// 2: ClFsensorPCB::_Rev04 -> oFsensorPCB=ClFsensorPCB::_Old and print _i("FS v0.3 or older")
|
|
|
+void manage_inactivity_IR_ANALOG_Check(uint16_t &nFSCheckCount, ClFsensorPCB isVersion, ClFsensorPCB switchTo, const char *statusLineTxt_P) {
|
|
|
+ bool bTemp = (!CHECK_ALL_HEATERS);
|
|
|
+ bTemp = bTemp && (menu_menu == lcd_status_screen);
|
|
|
+ bTemp = bTemp && ((oFsensorPCB == isVersion) || (oFsensorPCB == ClFsensorPCB::_Undef));
|
|
|
+ bTemp = bTemp && fsensor_enabled;
|
|
|
+ if (bTemp) {
|
|
|
+ nFSCheckCount++;
|
|
|
+ if (nFSCheckCount > FS_CHECK_COUNT) {
|
|
|
+ nFSCheckCount = 0; // not necessary
|
|
|
+ oFsensorPCB = switchTo;
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_FSENSOR_PCB, (uint8_t)oFsensorPCB);
|
|
|
+ printf_IRSensorAnalogBoardChange();
|
|
|
+ lcd_setstatuspgm(statusLineTxt_P);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ nFSCheckCount = 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h
|
|
|
{
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
bool bInhibitFlag;
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
-static uint8_t nFSCheckCount=0;
|
|
|
+static uint16_t nFSCheckCount=0;
|
|
|
#endif // IR_SENSOR_ANALOG
|
|
|
|
|
|
if (mmu_enabled == false)
|
|
|
{
|
|
|
//-// if (mcode_in_progress != 600) //M600 not in progress
|
|
|
#ifdef PAT9125
|
|
|
- bInhibitFlag=(menu_menu==lcd_menu_extruder_info); // Support::ExtruderInfo menu active
|
|
|
+ bInhibitFlag=(menu_menu==lcd_menu_extruder_info); // Support::ExtruderInfo menu active
|
|
|
#endif // PAT9125
|
|
|
#ifdef IR_SENSOR
|
|
|
- bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); // Support::SensorInfo menu active
|
|
|
+ bInhibitFlag=(menu_menu==lcd_menu_show_sensors_state); // Support::SensorInfo menu active
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
- bInhibitFlag=bInhibitFlag||bMenuFSDetect; // Settings::HWsetup::FSdetect menu active
|
|
|
+ bInhibitFlag=bInhibitFlag||bMenuFSDetect; // Settings::HWsetup::FSdetect menu active
|
|
|
#endif // IR_SENSOR_ANALOG
|
|
|
#endif // IR_SENSOR
|
|
|
- if ((mcode_in_progress != 600) && (eFilamentAction != FilamentAction::AutoLoad) && (!bInhibitFlag)) //M600 not in progress, preHeat @ autoLoad menu not active, Support::ExtruderInfo/SensorInfo menu not active
|
|
|
+ if ((mcode_in_progress != 600) && (eFilamentAction != FilamentAction::AutoLoad) && (!bInhibitFlag) && (menu_menu != lcd_move_e)) //M600 not in progress, preHeat @ autoLoad menu not active, Support::ExtruderInfo/SensorInfo menu not active
|
|
|
{
|
|
|
if (!moves_planned() && !IS_SD_PRINTING && !is_usb_printing && (lcd_commands_type != LcdCommands::Layer1Cal) && ! eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
{
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
- bool bTemp=current_voltage_raw_IR>IRsensor_Hmin_TRESHOLD;
|
|
|
- bTemp=bTemp&¤t_voltage_raw_IR<IRsensor_Hopen_TRESHOLD;
|
|
|
- bTemp=bTemp&&(!CHECK_ALL_HEATERS);
|
|
|
- bTemp=bTemp&&(menu_menu==lcd_status_screen);
|
|
|
- bTemp=bTemp&&((oFsensorPCB==ClFsensorPCB::_Old)||(oFsensorPCB==ClFsensorPCB::_Undef));
|
|
|
- bTemp=bTemp&&fsensor_enabled;
|
|
|
- if(bTemp)
|
|
|
- {
|
|
|
- nFSCheckCount++;
|
|
|
- if(nFSCheckCount>FS_CHECK_COUNT)
|
|
|
- {
|
|
|
- nFSCheckCount=0; // not necessary
|
|
|
- oFsensorPCB=ClFsensorPCB::_Rev03b;
|
|
|
- eeprom_update_byte((uint8_t*)EEPROM_FSENSOR_PCB,(uint8_t)oFsensorPCB);
|
|
|
- printf_IRSensorAnalogBoardChange(true);
|
|
|
- lcd_setstatuspgm(_i("FS rev. 03b or newer"));
|
|
|
- }
|
|
|
- }
|
|
|
- else nFSCheckCount=0;
|
|
|
+ static uint16_t minVolt = Voltage2Raw(6.F), maxVolt = 0;
|
|
|
+ // detect min-max, some long term sliding window for filtration may be added
|
|
|
+ // avoiding floating point operations, thus computing in raw
|
|
|
+ if( current_voltage_raw_IR > maxVolt )maxVolt = current_voltage_raw_IR;
|
|
|
+ if( current_voltage_raw_IR < minVolt )minVolt = current_voltage_raw_IR;
|
|
|
+
|
|
|
+#if 0 // Start: IR Sensor debug info
|
|
|
+ { // debug print
|
|
|
+ static uint16_t lastVolt = ~0U;
|
|
|
+ if( current_voltage_raw_IR != lastVolt ){
|
|
|
+ printf_P(PSTR("fs volt=%4.2fV (min=%4.2f max=%4.2f)\n"), Raw2Voltage(current_voltage_raw_IR), Raw2Voltage(minVolt), Raw2Voltage(maxVolt) );
|
|
|
+ lastVolt = current_voltage_raw_IR;
|
|
|
+ }
|
|
|
+ }
|
|
|
+#endif // End: IR Sensor debug info
|
|
|
+ //! The trouble is, I can hold the filament in the hole in such a way, that it creates the exact voltage
|
|
|
+ //! to be detected as the new fsensor
|
|
|
+ //! We can either fake it by extending the detection window to a looooong time
|
|
|
+ //! or do some other countermeasures
|
|
|
+
|
|
|
+ //! what we want to detect:
|
|
|
+ //! if minvolt gets below ~0.3V, it means there is an old fsensor
|
|
|
+ //! if maxvolt gets above 4.6V, it means we either have an old fsensor or broken cables/fsensor
|
|
|
+ //! So I'm waiting for a situation, when minVolt gets to range <0, 1.5> and maxVolt gets into range <3.0, 5>
|
|
|
+ //! If and only if minVolt is in range <0.3, 1.5> and maxVolt is in range <3.0, 4.6>, I'm considering a situation with the new fsensor
|
|
|
+ if( minVolt >= IRsensor_Ldiode_TRESHOLD && minVolt <= IRsensor_Lmax_TRESHOLD
|
|
|
+ && maxVolt >= IRsensor_Hmin_TRESHOLD && maxVolt <= IRsensor_Hopen_TRESHOLD
|
|
|
+ ){
|
|
|
+ manage_inactivity_IR_ANALOG_Check(nFSCheckCount, ClFsensorPCB::_Old, ClFsensorPCB::_Rev04, _i("FS v0.4 or newer") ); ////c=18
|
|
|
+ }
|
|
|
+ //! If and only if minVolt is in range <0.0, 0.3> and maxVolt is in range <4.6, 5.0V>, I'm considering a situation with the old fsensor
|
|
|
+ //! Note, we are not relying on one voltage here - getting just +5V can mean an old fsensor or a broken new sensor - that's why
|
|
|
+ //! we need to have both voltages detected correctly to allow switching back to the old fsensor.
|
|
|
+ else if( minVolt < IRsensor_Ldiode_TRESHOLD
|
|
|
+ && maxVolt > IRsensor_Hopen_TRESHOLD && maxVolt <= IRsensor_VMax_TRESHOLD
|
|
|
+ ){
|
|
|
+ manage_inactivity_IR_ANALOG_Check(nFSCheckCount, ClFsensorPCB::_Rev04, oFsensorPCB=ClFsensorPCB::_Old, _i("FS v0.3 or older")); ////c=18
|
|
|
+ }
|
|
|
#endif // IR_SENSOR_ANALOG
|
|
|
if (fsensor_check_autoload())
|
|
|
{
|
|
@@ -9548,7 +9776,7 @@ static uint8_t nFSCheckCount=0;
|
|
|
//-// if (degHotend0() > EXTRUDE_MINTEMP)
|
|
|
if(0)
|
|
|
{
|
|
|
- Sound_MakeCustom(50,1000,false);
|
|
|
+ Sound_MakeCustom(50,1000,false);
|
|
|
loading_flag = true;
|
|
|
enquecommand_front_P((PSTR("M701")));
|
|
|
}
|
|
@@ -9559,20 +9787,17 @@ if(0)
|
|
|
show_preheat_nozzle_warning();
|
|
|
lcd_update_enable(true);
|
|
|
*/
|
|
|
- eFilamentAction=FilamentAction::AutoLoad;
|
|
|
- bFilamentFirstRun=false;
|
|
|
- if(target_temperature[0]>=EXTRUDE_MINTEMP)
|
|
|
- {
|
|
|
- bFilamentPreheatState=true;
|
|
|
-// mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
- menu_submenu(mFilamentItemForce);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- menu_submenu(lcd_generic_preheat_menu);
|
|
|
- lcd_timeoutToStatus.start();
|
|
|
- }
|
|
|
- }
|
|
|
+ eFilamentAction=FilamentAction::AutoLoad;
|
|
|
+ bFilamentFirstRun=false;
|
|
|
+ if(target_temperature[0]>=EXTRUDE_MINTEMP){
|
|
|
+ bFilamentPreheatState=true;
|
|
|
+// mFilamentItem(target_temperature[0],target_temperature_bed);
|
|
|
+ menu_submenu(mFilamentItemForce);
|
|
|
+ } else {
|
|
|
+ menu_submenu(lcd_generic_preheat_menu);
|
|
|
+ lcd_timeoutToStatus.start();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -9746,6 +9971,24 @@ void Stop()
|
|
|
|
|
|
bool IsStopped() { return Stopped; };
|
|
|
|
|
|
+void finishAndDisableSteppers()
|
|
|
+{
|
|
|
+ st_synchronize();
|
|
|
+ disable_x();
|
|
|
+ disable_y();
|
|
|
+ disable_z();
|
|
|
+ disable_e0();
|
|
|
+ disable_e1();
|
|
|
+ disable_e2();
|
|
|
+
|
|
|
+#ifndef LA_NOCOMPAT
|
|
|
+ // Steppers are disabled both when a print is stopped and also via M84 (which is additionally
|
|
|
+ // checked-for to indicate a complete file), so abuse this function to reset the LA detection
|
|
|
+ // state for the next print.
|
|
|
+ la10c_reset();
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
#ifdef FAST_PWM_FAN
|
|
|
void setPwmFrequency(uint8_t pin, int val)
|
|
|
{
|
|
@@ -9837,16 +10080,16 @@ bool setTargetedHotend(int code, uint8_t &extruder)
|
|
|
SERIAL_ECHORPGM(_n("M104 Invalid extruder "));////MSG_M104_INVALID_EXTRUDER
|
|
|
break;
|
|
|
case 105:
|
|
|
- SERIAL_ECHO(_n("M105 Invalid extruder "));////MSG_M105_INVALID_EXTRUDER
|
|
|
+ SERIAL_ECHORPGM(_n("M105 Invalid extruder "));////MSG_M105_INVALID_EXTRUDER
|
|
|
break;
|
|
|
case 109:
|
|
|
- SERIAL_ECHO(_n("M109 Invalid extruder "));////MSG_M109_INVALID_EXTRUDER
|
|
|
+ SERIAL_ECHORPGM(_n("M109 Invalid extruder "));////MSG_M109_INVALID_EXTRUDER
|
|
|
break;
|
|
|
case 218:
|
|
|
- SERIAL_ECHO(_n("M218 Invalid extruder "));////MSG_M218_INVALID_EXTRUDER
|
|
|
+ SERIAL_ECHORPGM(_n("M218 Invalid extruder "));////MSG_M218_INVALID_EXTRUDER
|
|
|
break;
|
|
|
case 221:
|
|
|
- SERIAL_ECHO(_n("M221 Invalid extruder "));////MSG_M221_INVALID_EXTRUDER
|
|
|
+ SERIAL_ECHORPGM(_n("M221 Invalid extruder "));////MSG_M221_INVALID_EXTRUDER
|
|
|
break;
|
|
|
}
|
|
|
SERIAL_PROTOCOLLN((int)extruder);
|
|
@@ -9946,11 +10189,11 @@ static void wait_for_heater(long codenum, uint8_t extruder) {
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SERIAL_PROTOCOLLN("?");
|
|
|
+ SERIAL_PROTOCOLLN('?');
|
|
|
}
|
|
|
}
|
|
|
#else
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
#endif
|
|
|
codenum = _millis();
|
|
|
}
|
|
@@ -10077,16 +10320,16 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
|
|
card.openFile(filename_wldsd, false);
|
|
|
|
|
|
/*destination[Z_AXIS] = mesh_home_z_search;
|
|
|
- //plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ //plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
|
|
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
|
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
|
|
current_position[i] = destination[i];
|
|
|
}
|
|
|
st_synchronize();
|
|
|
*/
|
|
|
destination[Z_AXIS] = measure_z_height;
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
|
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
|
|
current_position[i] = destination[i];
|
|
|
}
|
|
@@ -10111,9 +10354,9 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
|
|
if (iy & 1) ix = (x_points_num - 1) - ix; // Zig zag
|
|
|
float z0 = 0.f;
|
|
|
/*destination[Z_AXIS] = mesh_home_z_search;
|
|
|
- //plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ //plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE);
|
|
|
|
|
|
- plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], Z_LIFT_FEEDRATE, active_extruder);
|
|
|
+ plan_buffer_line_destinationXYZE(Z_LIFT_FEEDRATE);
|
|
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
|
|
current_position[i] = destination[i];
|
|
|
}
|
|
@@ -10126,8 +10369,8 @@ void bed_check(float x_dimension, float y_dimension, int x_points_num, int y_poi
|
|
|
destination[X_AXIS] = ix * (x_dimension / (x_points_num - 1)) + shift_x;
|
|
|
destination[Y_AXIS] = iy * (y_dimension / (y_points_num - 1)) + shift_y;
|
|
|
|
|
|
- mesh_plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], XY_AXIS_FEEDRATE/6, active_extruder);
|
|
|
- set_current_to_destination();
|
|
|
+ mesh_plan_buffer_line_destinationXYZE(XY_AXIS_FEEDRATE/6);
|
|
|
+ set_current_to_destination();
|
|
|
st_synchronize();
|
|
|
|
|
|
// printf_P(PSTR("X = %f; Y= %f \n"), current_position[X_AXIS], current_position[Y_AXIS]);
|
|
@@ -10257,7 +10500,7 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
|
|
|
// There shall be always enough space reserved for these commands.
|
|
|
repeatcommand_front(); // repeat G80 with all its parameters
|
|
|
|
|
|
- enquecommand_front_P((PSTR("G28 W0")));
|
|
|
+ enquecommand_front_P(G28W0);
|
|
|
enquecommand_front_P((PSTR("G1 Z5")));
|
|
|
return;
|
|
|
}
|
|
@@ -10480,7 +10723,11 @@ float temp_comp_interpolation(float inp_temperature) {
|
|
|
if (i>0) EEPROM_read_B(EEPROM_PROBE_TEMP_SHIFT + (i-1) * 2, &shift[i]); //read shift in steps from EEPROM
|
|
|
temp_C[i] = 50 + i * 10; //temperature in C
|
|
|
#ifdef PINDA_THERMISTOR
|
|
|
- temp_C[i] = 35 + i * 5; //temperature in C
|
|
|
+ constexpr int start_compensating_temp = 35;
|
|
|
+ temp_C[i] = start_compensating_temp + i * 5; //temperature in degrees C
|
|
|
+#ifdef SUPERPINDA_SUPPORT
|
|
|
+ static_assert(start_compensating_temp >= PINDA_MINTEMP, "Temperature compensation start point is lower than PINDA_MINTEMP.");
|
|
|
+#endif //SUPERPINDA_SUPPORT
|
|
|
#else
|
|
|
temp_C[i] = 50 + i * 10; //temperature in C
|
|
|
#endif
|
|
@@ -10533,7 +10780,7 @@ float temp_comp_interpolation(float inp_temperature) {
|
|
|
#ifdef PINDA_THERMISTOR
|
|
|
float temp_compensation_pinda_thermistor_offset(float temperature_pinda)
|
|
|
{
|
|
|
- if (!temp_cal_active) return 0;
|
|
|
+ if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0;
|
|
|
if (!calibration_status_pinda()) return 0;
|
|
|
return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_unit[Z_AXIS];
|
|
|
}
|
|
@@ -10550,12 +10797,12 @@ void long_pause() //long pause print
|
|
|
//lift z
|
|
|
current_position[Z_AXIS] += Z_PAUSE_LIFT;
|
|
|
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
|
|
|
- plan_buffer_line_curposXYZE(15, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(15);
|
|
|
|
|
|
//Move XY to side
|
|
|
current_position[X_AXIS] = X_PAUSE_POS;
|
|
|
current_position[Y_AXIS] = Y_PAUSE_POS;
|
|
|
- plan_buffer_line_curposXYZE(50, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(50);
|
|
|
|
|
|
// Turn off the print fan
|
|
|
fanSpeed = 0;
|
|
@@ -10569,7 +10816,7 @@ void serialecho_temperatures() {
|
|
|
SERIAL_PROTOCOL((int)active_extruder);
|
|
|
SERIAL_PROTOCOLPGM(" B:");
|
|
|
SERIAL_PROTOCOL_F(degBed(), 1);
|
|
|
- SERIAL_PROTOCOLLN("");
|
|
|
+ SERIAL_PROTOCOLLN();
|
|
|
}
|
|
|
|
|
|
#ifdef UVLO_SUPPORT
|
|
@@ -10665,7 +10912,7 @@ void uvlo_()
|
|
|
|
|
|
// Retract
|
|
|
current_position[E_AXIS] -= default_retraction;
|
|
|
- plan_buffer_line_curposXYZE(95, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(95);
|
|
|
st_synchronize();
|
|
|
disable_e0();
|
|
|
|
|
@@ -10678,7 +10925,7 @@ void uvlo_()
|
|
|
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
|
|
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
|
|
+ UVLO_Z_AXIS_SHIFT;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60);
|
|
|
st_synchronize();
|
|
|
poweroff_z();
|
|
|
|
|
@@ -10718,6 +10965,10 @@ void uvlo_()
|
|
|
#endif
|
|
|
eeprom_update_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY), (uint16_t)extrudemultiply);
|
|
|
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_ACCELL), cs.acceleration);
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_RETRACT_ACCELL), cs.retract_acceleration);
|
|
|
+ eeprom_update_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL), cs.travel_acceleration);
|
|
|
+
|
|
|
// Store the saved target
|
|
|
eeprom_update_float((float*)(EEPROM_UVLO_SAVED_TARGET+0*4), saved_target[X_AXIS]);
|
|
|
eeprom_update_float((float*)(EEPROM_UVLO_SAVED_TARGET+1*4), saved_target[Y_AXIS]);
|
|
@@ -10741,7 +10992,7 @@ void uvlo_()
|
|
|
// All is set: with all the juice left, try to move extruder away to detach the nozzle completely from the print
|
|
|
poweron_z();
|
|
|
current_position[X_AXIS] = (current_position[X_AXIS] < 0.5f * (X_MIN_POS + X_MAX_POS)) ? X_MIN_POS : X_MAX_POS;
|
|
|
- plan_buffer_line_curposXYZE(500, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(500);
|
|
|
st_synchronize();
|
|
|
|
|
|
wdt_enable(WDTO_1S);
|
|
@@ -10792,7 +11043,7 @@ void uvlo_tiny()
|
|
|
current_position[Z_AXIS] += float(1024 - z_microsteps)
|
|
|
/ (z_res * cs.axis_steps_per_unit[Z_AXIS])
|
|
|
+ UVLO_TINY_Z_AXIS_SHIFT;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60);
|
|
|
st_synchronize();
|
|
|
poweroff_z();
|
|
|
|
|
@@ -10886,7 +11137,7 @@ void recover_print(uint8_t automatic) {
|
|
|
char cmd[30];
|
|
|
lcd_update_enable(true);
|
|
|
lcd_update(2);
|
|
|
- lcd_setstatuspgm(_i("Recovering print "));////MSG_RECOVERING_PRINT c=20 r=1
|
|
|
+ lcd_setstatuspgm(_i("Recovering print "));////MSG_RECOVERING_PRINT c=20
|
|
|
|
|
|
// Recover position, temperatures and extrude_multipliers
|
|
|
bool mbl_was_active = recover_machine_state_after_power_panic();
|
|
@@ -10971,7 +11222,7 @@ bool recover_machine_state_after_power_panic()
|
|
|
|
|
|
// 5) Set the physical positions from the logical positions using the world2machine transformation
|
|
|
// This is only done to inizialize Z/E axes with physical locations, since X/Y are unknown.
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
// 6) Power up the Z motors, mark their positions as known.
|
|
|
axis_known_position[Z_AXIS] = true;
|
|
@@ -11062,6 +11313,13 @@ void restore_print_from_eeprom(bool mbl_was_active) {
|
|
|
sprintf_P(cmd, PSTR("G1 Z%f"), eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_Z)));
|
|
|
enquecommand(cmd);
|
|
|
|
|
|
+ // Restore acceleration settings
|
|
|
+ float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL));
|
|
|
+ float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL));
|
|
|
+ float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL));
|
|
|
+ sprintf_P(cmd, PSTR("M204 P%f R%f T%f"), acceleration, retract_acceleration, travel_acceleration);
|
|
|
+ enquecommand(cmd);
|
|
|
+
|
|
|
// Unretract.
|
|
|
sprintf_P(cmd, PSTR("G1 E%0.3f F2700"), default_retraction);
|
|
|
enquecommand(cmd);
|
|
@@ -11363,7 +11621,6 @@ void restore_print_from_ram_and_continue(float e_move)
|
|
|
//not sd printing nor usb printing
|
|
|
}
|
|
|
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OK); //dummy response because of octoprint is waiting for this
|
|
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
|
|
saved_printing_type = PRINTING_TYPE_NONE;
|
|
|
saved_printing = false;
|
|
@@ -11395,9 +11652,9 @@ void print_mesh_bed_leveling_table()
|
|
|
for (int8_t y = 0; y < MESH_NUM_Y_POINTS; ++ y)
|
|
|
for (int8_t x = 0; x < MESH_NUM_Y_POINTS; ++ x) {
|
|
|
MYSERIAL.print(mbl.z_values[y][x], 3);
|
|
|
- SERIAL_ECHOPGM(" ");
|
|
|
+ SERIAL_ECHO(' ');
|
|
|
}
|
|
|
- SERIAL_ECHOLNPGM("");
|
|
|
+ SERIAL_ECHOLN();
|
|
|
}
|
|
|
|
|
|
uint16_t print_time_remaining() {
|
|
@@ -11445,7 +11702,7 @@ static void print_time_remaining_init()
|
|
|
void load_filament_final_feed()
|
|
|
{
|
|
|
current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL);
|
|
|
}
|
|
|
|
|
|
//! @brief Wait for user to check the state
|
|
@@ -11529,7 +11786,7 @@ void M600_wait_for_user(float HotendTempBckp) {
|
|
|
delay_keep_alive(4);
|
|
|
|
|
|
if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) {
|
|
|
- lcd_display_message_fullscreen_P(_i("Press knob to preheat nozzle and continue."));////MSG_PRESS_TO_PREHEAT c=20 r=4
|
|
|
+ lcd_display_message_fullscreen_P(_i("Press the knob to preheat nozzle and continue."));////MSG_PRESS_TO_PREHEAT c=20 r=4
|
|
|
wait_for_user_state = 1;
|
|
|
setAllTargetHotends(0);
|
|
|
st_synchronize();
|
|
@@ -11590,7 +11847,7 @@ void M600_load_filament_movements()
|
|
|
plan_buffer_line_curposXYZE(50, active_extruder);
|
|
|
#else
|
|
|
current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED ;
|
|
|
- plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST);
|
|
|
#endif
|
|
|
load_filament_final_feed();
|
|
|
lcd_loading_filament();
|
|
@@ -11697,7 +11954,6 @@ void disable_force_z()
|
|
|
#endif // TMC2130
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void enable_force_z()
|
|
|
{
|
|
|
if(bEnableForce_z)
|