Add #ifdef

This commit is contained in:
sarusani 2023-12-15 14:09:46 +01:00
parent 1407f29362
commit e5d6d72d23
15 changed files with 128 additions and 33 deletions

View File

@ -3545,7 +3545,10 @@ void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){
lcd_load_filament_color_check(); lcd_load_filament_color_check();
} }
retract_for_ooze_prevention(); // Retract a little of filament to prevent oozing #ifdef COMMUNITY_PREVENT_OOZE
// Retract filament to prevent oozing
retract_for_ooze_prevention();
#endif //COMMUNITY_PREVENT_OOZE
lcd_update_enable(true); lcd_update_enable(true);
lcd_update(2); lcd_update(2);

View File

@ -5603,14 +5603,16 @@ static void lcd_sd_updir()
menu_data_reset(); //Forces reloading of cached variables. menu_data_reset(); //Forces reloading of cached variables.
} }
/// @brief retract a little of filament to prevent oozing #ifdef COMMUNITY_PREVENT_OOZE
/// @brief Retract filament to prevent oozing
void retract_for_ooze_prevention() { void retract_for_ooze_prevention() {
current_position[E_AXIS] += FILAMENTCHANGE_ROOZEFEED; current_position[E_AXIS] += FILAMENTCHANGE_COMMUNITY_ROOZEFEED;
plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED);
current_position[E_AXIS] += FILAMENTCHANGE_EOOZEFEED; current_position[E_AXIS] += FILAMENTCHANGE_COMMUNITY_EOOZEFEED;
plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST);
st_synchronize(); st_synchronize();
} }
#endif //COMMUNITY_PREVENT_OOZE
// continue stopping the print from the main loop after lcd_print_stop() is called // continue stopping the print from the main loop after lcd_print_stop() is called
void lcd_print_stop_finish() void lcd_print_stop_finish()
@ -5626,10 +5628,13 @@ void lcd_print_stop_finish()
current_position[Y_AXIS] = Y_CANCEL_POS; current_position[Y_AXIS] = Y_CANCEL_POS;
plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
} }
st_synchronize();
// Retract a little of filament to prevent oozing #ifdef COMMUNITY_PREVENT_OOZE
// Retract filament to prevent oozing
retract_for_ooze_prevention(); retract_for_ooze_prevention();
#endif //COMMUNITY_PREVENT_OOZE
// did we come here from a thermal error? // did we come here from a thermal error?
if(get_temp_error()) { if(get_temp_error()) {
// time to stop the error beep // time to stop the error beep

View File

@ -253,6 +253,9 @@ extern void lcd_pinda_temp_compensation_toggle();
#endif //PINDA_TEMP_COMP #endif //PINDA_TEMP_COMP
extern void lcd_heat_bed_on_load_toggle(); extern void lcd_heat_bed_on_load_toggle();
#ifdef COMMUNITY_PREVENT_OOZE
extern void retract_for_ooze_prevention(); extern void retract_for_ooze_prevention();
#endif //COMMUNITY_PREVENT_OOZE
#endif //ULTRALCD_H #endif //ULTRALCD_H

View File

@ -232,8 +232,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -233,8 +233,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -232,8 +232,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -233,8 +233,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -366,8 +366,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -367,8 +367,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -369,8 +369,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -370,8 +370,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -371,8 +371,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -373,8 +373,15 @@
#define FILAMENTCHANGE_RFEED 7000 / 60 #define FILAMENTCHANGE_RFEED 7000 / 60
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -161,8 +161,15 @@ CHANGE FILAMENT SETTINGS
#define FILAMENTCHANGE_RFEED 400 #define FILAMENTCHANGE_RFEED 400
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif

View File

@ -160,8 +160,15 @@ CHANGE FILAMENT SETTINGS
#define FILAMENTCHANGE_RFEED 400 #define FILAMENTCHANGE_RFEED 400
#define FILAMENTCHANGE_EXFEED 2 #define FILAMENTCHANGE_EXFEED 2
#define FILAMENTCHANGE_ZFEED 15 #define FILAMENTCHANGE_ZFEED 15
#define FILAMENTCHANGE_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_EOOZEFEED 4 //E extrude distance in mm for ooze prevention //Retract and then extrude some filament to prevent oozing.
//After the loading sequence and after a print is canceled, the filament is retracted to get it out of the heat zone of the nozzle.
//Then a small extrusion is performed to make sure the filament is close enough for the next print without oozing.
//#define COMMUNITY_PREVENT_OOZE
#ifdef COMMUNITY_PREVENT_OOZE
#define FILAMENTCHANGE_COMMUNITY_ROOZEFEED -10 //E retract distance in mm for ooze prevention
#define FILAMENTCHANGE_COMMUNITY_EOOZEFEED 4 //E extrude distance in mm for ooze prevention
#endif //End COMMUNITY_PREVENT_OOZE
#endif #endif