Skip to content

Commit

Permalink
Merge pull request #1945 from NotaRobotexe/fan_er
Browse files Browse the repository at this point in the history
fan error fix
  • Loading branch information
DRracer committed Jun 24, 2019
2 parents fee67d9 + 3e9dc91 commit c34701c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Firmware/Marlin_main.cpp
Expand Up @@ -9387,6 +9387,11 @@ void restore_print_from_ram_and_continue(float e_move)
fanSpeed = saved_fanSpeed;
float e = saved_pos[E_AXIS] - e_move;
plan_set_e_position(e);

#ifdef FANCHECK
fans_check_enabled = false;
#endif

//first move print head in XY to the saved position:
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], saved_pos[E_AXIS] - e_move, homing_feedrate[Z_AXIS]/13, active_extruder);
st_synchronize();
Expand All @@ -9397,6 +9402,10 @@ void restore_print_from_ram_and_continue(float e_move)
plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], saved_pos[E_AXIS], 35, active_extruder);
st_synchronize();

#ifdef FANCHECK
fans_check_enabled = true;
#endif

memcpy(current_position, saved_pos, sizeof(saved_pos));
memcpy(destination, current_position, sizeof(destination));
if (saved_printing_type == PRINTING_TYPE_SD) { //was sd printing
Expand Down
7 changes: 5 additions & 2 deletions Firmware/temperature.cpp
Expand Up @@ -500,8 +500,9 @@ void checkFanSpeed()
max_print_fan_errors = 15; //15 seconds
max_extruder_fan_errors = 5; //5 seconds
#endif //FAN_SOFT_PWM

fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0);

if(fans_check_enabled != false)
fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0);
static unsigned char fan_speed_errors[2] = { 0,0 };
#if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 >-1))
if ((fan_speed[0] == 0) && (current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE)) fan_speed_errors[0]++;
Expand Down Expand Up @@ -560,6 +561,8 @@ void fanSpeedError(unsigned char _fan) {
else {
setTargetHotend0(0);
SERIAL_ECHOLNPGM("// action:pause"); //for octoprint
heating_status = 0;
fan_check_error = EFCE_REPORTED;
}
switch (_fan) {
case 0: // extracting the same code from case 0 and case 1 into a function saves 72B
Expand Down
10 changes: 9 additions & 1 deletion Firmware/ultralcd.cpp
Expand Up @@ -6380,6 +6380,7 @@ static void lcd_test_menu()
void lcd_resume_print()
{
lcd_return_to_status();
lcd_reset_alert_level();
lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
lcd_reset_alert_level(); //for fan speed error
restore_print_from_ram_and_continue(0.0);
Expand Down Expand Up @@ -6485,7 +6486,14 @@ static void lcd_main_menu()
}
else
{
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#ifdef FANCHECK
checkFanSpeed(); //Check manually to get most recent fan speed status
if(fan_check_error == EFCE_OK)
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#else
MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);////MSG_RESUME_PRINT
#endif

}
MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
}
Expand Down

0 comments on commit c34701c

Please sign in to comment.