|
@@ -142,10 +142,6 @@
|
|
|
|
|
|
#define FAN_PULSE_WIDTH_LIMIT ((fanSpeed > 100) ? 3 : 4)
|
|
|
|
|
|
-#define PRINTING_TYPE_SD 0
|
|
|
-#define PRINTING_TYPE_USB 1
|
|
|
-#define PRINTING_TYPE_NONE 2
|
|
|
-
|
|
|
|
|
|
#define FILAMENT_DEFAULT 0
|
|
|
#define FILAMENT_FLEX 1
|
|
@@ -375,7 +371,7 @@ boolean chdkActive = false;
|
|
|
|
|
|
bool saved_printing = false;
|
|
|
static uint32_t saved_sdpos = 0;
|
|
|
-static uint8_t saved_printing_type = PRINTING_TYPE_SD;
|
|
|
+uint8_t saved_printing_type = PRINTING_TYPE_SD;
|
|
|
static float saved_pos[4] = { 0, 0, 0, 0 };
|
|
|
|
|
|
static float saved_feedrate2 = 0;
|
|
@@ -623,7 +619,7 @@ void crashdet_cancel()
|
|
|
if (saved_printing_type == PRINTING_TYPE_SD) {
|
|
|
lcd_print_stop();
|
|
|
}else if(saved_printing_type == PRINTING_TYPE_USB){
|
|
|
- SERIAL_ECHOLNPGM("// action:cancel");
|
|
|
+ SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL);
|
|
|
SERIAL_PROTOCOLLNRPGM(MSG_OK);
|
|
|
}
|
|
|
}
|
|
@@ -1527,7 +1523,7 @@ void setup()
|
|
|
calibration_status() == CALIBRATION_STATUS_UNKNOWN ||
|
|
|
calibration_status() == CALIBRATION_STATUS_XYZ_CALIBRATION) {
|
|
|
|
|
|
- eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0);
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
|
|
|
|
|
lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW));
|
|
|
}
|
|
@@ -1751,12 +1747,25 @@ void loop()
|
|
|
{
|
|
|
is_usb_printing = false;
|
|
|
}
|
|
|
+ if (isPrintPaused && saved_printing_type == PRINTING_TYPE_USB)
|
|
|
+ {
|
|
|
+ is_usb_printing = true;
|
|
|
+ }
|
|
|
+
|
|
|
+#ifdef FANCHECK
|
|
|
+ if (fan_check_error && isPrintPaused)
|
|
|
+ {
|
|
|
+ KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
+ host_keepalive();
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
if (prusa_sd_card_upload)
|
|
|
{
|
|
|
|
|
|
serial_read_stream();
|
|
|
- } else
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
|
|
|
get_command();
|
|
@@ -2694,6 +2703,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
|
|
previous_millis_cmd = _millis();
|
|
|
endstops_hit_on_purpose();
|
|
|
#ifndef MESH_BED_LEVELING
|
|
|
+
|
|
|
|
|
|
|
|
|
if(card.sdprinting && eeprom_read_word((uint16_t *)EEPROM_BABYSTEP_Z))
|
|
@@ -2886,7 +2896,7 @@ bool gcode_M45(bool onlyZ, int8_t verbosity_level)
|
|
|
{
|
|
|
|
|
|
calibration_status_store(CALIBRATION_STATUS_XYZ_CALIBRATION);
|
|
|
- eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0);
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
|
|
|
|
|
uint8_t point_too_far_mask = 0;
|
|
|
BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask);
|
|
@@ -3450,22 +3460,16 @@ extern uint8_t st_backlash_y;
|
|
|
|
|
|
void process_commands()
|
|
|
{
|
|
|
- #ifdef FANCHECK
|
|
|
- if (fan_check_error){
|
|
|
- if( fan_check_error == EFCE_DETECTED ){
|
|
|
- fan_check_error = EFCE_REPORTED;
|
|
|
-
|
|
|
- if(is_usb_printing){
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSE);
|
|
|
- }
|
|
|
- else{
|
|
|
- lcd_pause_print();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- return;
|
|
|
- }
|
|
|
- #endif
|
|
|
+#ifdef FANCHECK
|
|
|
+ if(fan_check_error){
|
|
|
+ if(fan_check_error == EFCE_DETECTED){
|
|
|
+ fan_check_error = EFCE_REPORTED;
|
|
|
+
|
|
|
+ lcd_pause_print();
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ }
|
|
|
+#endif
|
|
|
|
|
|
if (!buflen) return;
|
|
|
#ifdef FILAMENT_RUNOUT_SUPPORT
|
|
@@ -3736,7 +3740,7 @@ void process_commands()
|
|
|
lang_reset();
|
|
|
|
|
|
} else if(code_seen("Lz")) {
|
|
|
- EEPROM_save_B(EEPROM_BABYSTEP_Z,0);
|
|
|
+ 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")) {
|
|
|
|
|
@@ -5503,7 +5507,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
|
|
|
|
|
|
|
|
calibration_status_store(CALIBRATION_STATUS_ASSEMBLED);
|
|
|
- eeprom_update_word((uint16_t*)EEPROM_BABYSTEP_Z, 0);
|
|
|
+ eeprom_update_word(reinterpret_cast<uint16_t *>(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0);
|
|
|
|
|
|
|
|
|
reset_bed_offset_and_skew();
|
|
@@ -10165,7 +10169,8 @@ void restore_print_from_ram_and_continue(float e_move)
|
|
|
|
|
|
#ifdef FANCHECK
|
|
|
|
|
|
- if( fan_check_error != EFCE_OK )return;
|
|
|
+ if ((fan_check_error != EFCE_OK) && (fan_check_error != EFCE_FIXED)) return;
|
|
|
+ if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK;
|
|
|
#endif
|
|
|
|
|
|
|
|
@@ -10219,6 +10224,7 @@ void restore_print_from_ram_and_continue(float e_move)
|
|
|
}
|
|
|
SERIAL_PROTOCOLLNRPGM(MSG_OK);
|
|
|
lcd_setstatuspgm(_T(WELCOME_MSG));
|
|
|
+ saved_printing_type = PRINTING_TYPE_NONE;
|
|
|
saved_printing = false;
|
|
|
}
|
|
|
|