🔧 CONFIGURE_FILAMENT_CHANGE - Optional M603 (#26613)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
plampix 2024-01-03 16:43:18 +01:00 committed by GitHub
parent 4a9e102c2e
commit 6d407767e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 42 additions and 32 deletions

View file

@ -2054,7 +2054,7 @@
/**
* Enable detailed logging of G28, G29, M48, etc.
* Turn on with the command 'M111 S32'.
* NOTE: Requires a lot of PROGMEM!
* NOTE: Requires a lot of flash!
*/
//#define DEBUG_LEVELING_FEATURE
@ -2343,7 +2343,7 @@
*/
//#define EEPROM_SETTINGS // Persistent storage with M500 and M501
//#define DISABLE_M503 // Saves ~2700 bytes of flash. Disable for release!
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define EEPROM_CHITCHAT // Give feedback on EEPROM commands. Disable to save flash.
#define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load
#if ENABLED(EEPROM_SETTINGS)
//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.

View file

@ -1342,7 +1342,7 @@
#define CALIBRATION_NOZZLE_TIP_HEIGHT 1.0 // mm
#define CALIBRATION_NOZZLE_OUTER_DIAMETER 2.0 // mm
// Uncomment to enable reporting (required for "G425 V", but consumes PROGMEM).
// Uncomment to enable reporting (required for "G425 V", but consumes flash).
//#define CALIBRATION_REPORTING
// The true location and dimension the cube/bolt/washer on the bed.
@ -2929,6 +2929,7 @@
//#define FILAMENT_LOAD_UNLOAD_GCODES // Add M701/M702 Load/Unload G-codes, plus Load/Unload in the LCD Prepare menu.
//#define FILAMENT_UNLOAD_ALL_EXTRUDERS // Allow M702 to unload all extruders above a minimum target temp (as set by M302)
#define CONFIGURE_FILAMENT_CHANGE // Add M603 G-code and menu items. Requires ~1.3K bytes of flash.
#endif
// @section tmc_smart

View file

@ -39,7 +39,7 @@
#if ENABLED(MAX7219_DEBUG)
#define MAX7219_ERRORS // Disable to save 406 bytes of Program Memory
#define MAX7219_ERRORS // Requires ~400 bytes of flash
#include "max7219.h"

View file

@ -89,7 +89,9 @@ static xyze_pos_t resume_position;
PauseMode pause_mode = PAUSE_MODE_PAUSE_PRINT;
#endif
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
fil_change_settings_t fc_settings[EXTRUDERS];
#endif
#if HAS_MEDIA
#include "../sd/cardreader.h"

View file

@ -26,10 +26,6 @@
* This may be combined with related G-codes if features are consolidated.
*/
typedef struct {
float unload_length, load_length;
} fil_change_settings_t;
#include "../inc/MarlinConfigPre.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
@ -69,7 +65,20 @@ enum PauseMessage : char {
extern PauseMode pause_mode;
#endif
typedef struct FilamentChangeSettings {
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
float load_length, unload_length;
#else
static constexpr float load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH,
unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
#endif
} fil_change_settings_t;
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
extern fil_change_settings_t fc_settings[EXTRUDERS];
#else
constexpr fil_change_settings_t fc_settings[EXTRUDERS];
#endif
extern uint8_t did_pause_print;

View file

@ -20,9 +20,9 @@
*
*/
#include "../../../inc/MarlinConfig.h"
#include "../../../inc/MarlinConfigPre.h"
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
#include "../../gcode.h"
#include "../../../feature/pause.h"
@ -80,4 +80,4 @@ void GcodeSuite::M603_report(const bool forReplay/*=true*/) {
#endif
}
#endif // ADVANCED_PAUSE_FEATURE
#endif // CONFIGURE_FILAMENT_CHANGE

View file

@ -948,8 +948,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
#if ENABLED(ADVANCED_PAUSE_FEATURE)
case 600: M600(); break; // M600: Pause for Filament Change
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
case 603: M603(); break; // M603: Configure Filament Change
#endif
#endif
#if HAS_DUPLICATION_MODE
case 605: M605(); break; // M605: Set Dual X Carriage movement mode

View file

@ -2910,7 +2910,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
break;
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
case ADVANCED_LOAD:
if (draw) {
drawMenuItem(row, ICON_WriteEEPROM, F("Load Length"));
@ -2927,7 +2927,7 @@ void JyersDWIN::menuItemHandler(const uint8_t menu, const uint8_t item, bool dra
else
modifyValue(fc_settings[0].unload_length, 0, EXTRUDE_MAXLENGTH, 1);
break;
#endif // ADVANCED_PAUSE_FEATURE
#endif // CONFIGURE_FILAMENT_CHANGE
#if ENABLED(PREVENT_COLD_EXTRUSION)
case ADVANCED_COLD_EXTRUDE:

View file

@ -3302,7 +3302,7 @@ void drawFilSetMenu() {
#if ENABLED(PREVENT_COLD_EXTRUSION)
EDIT_ITEM(ICON_ExtrudeMinT, MSG_EXTRUDER_MIN_TEMP, onDrawPIntMenu, setExtMinT, &hmiData.extMinT);
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
EDIT_ITEM(ICON_FilLoad, MSG_FILAMENT_LOAD, onDrawPFloatMenu, setFilLoad, &fc_settings[0].load_length);
EDIT_ITEM(ICON_FilUnload, MSG_FILAMENT_UNLOAD, onDrawPFloatMenu, setFilUnload, &fc_settings[0].unload_length);
#endif

View file

@ -323,7 +323,7 @@ void NextionTFT::panelInfo(uint8_t req) {
SEND_PRINT_INFO("t8", getFilamentUsed_str);
break;
case 28: // Filament laod/unload
case 28: // Filament load/unload
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#define SEND_PAUSE_INFO(A, B) SEND_VALasTXT(A, fc_settings[getActiveTool()].B)
#else

View file

@ -136,7 +136,7 @@ void menu_backlash();
}
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
constexpr float extrude_maxlength = TERN(PREVENT_LENGTHY_EXTRUDE, EXTRUDE_MAXLENGTH, 999);
EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);

View file

@ -36,7 +36,7 @@
*/
// Change EEPROM version if the structure changes
#define EEPROM_VERSION "V89"
#define EEPROM_VERSION "V90"
#define EEPROM_OFFSET 100
// Check the integrity of data offsets.
@ -508,7 +508,7 @@ typedef struct SettingsDataStruct {
//
// ADVANCED_PAUSE_FEATURE
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
fil_change_settings_t fc_settings[EXTRUDERS]; // M603 T U L
#endif
@ -1551,11 +1551,8 @@ void MarlinSettings::postprocess() {
//
// Advanced Pause filament load & unload lengths
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
{
#if DISABLED(ADVANCED_PAUSE_FEATURE)
const fil_change_settings_t fc_settings[EXTRUDERS] = { 0, 0 };
#endif
_FIELD_TEST(fc_settings);
EEPROM_WRITE(fc_settings);
}
@ -2626,11 +2623,8 @@ void MarlinSettings::postprocess() {
//
// Advanced Pause filament load & unload lengths
//
#if HAS_EXTRUDERS
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
{
#if DISABLED(ADVANCED_PAUSE_FEATURE)
fil_change_settings_t fc_settings[EXTRUDERS];
#endif
_FIELD_TEST(fc_settings);
EEPROM_READ(fc_settings);
}
@ -3549,7 +3543,7 @@ void MarlinSettings::reset() {
//
// Advanced Pause filament load & unload lengths
//
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#if ENABLED(CONFIGURE_FILAMENT_CHANGE)
EXTRUDER_LOOP() {
fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH;
@ -3924,7 +3918,7 @@ void MarlinSettings::reset() {
//
// Advanced Pause filament load & unload lengths
//
TERN_(ADVANCED_PAUSE_FEATURE, gcode.M603_report(forReplay));
TERN_(CONFIGURE_FILAMENT_CHANGE, gcode.M603_report(forReplay));
//
// Tool-changing Parameters

View file

@ -18,6 +18,7 @@ opt_set E0_AUTO_FAN_PIN PC10 E1_AUTO_FAN_PIN PC11 E2_AUTO_FAN_PIN PC12 NEOPIXEL_
opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER BLTOUCH NEOPIXEL_LED Z_SAFE_HOMING NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE \
FILAMENT_RUNOUT_SENSOR FIL_RUNOUT4_PULLUP FIL_RUNOUT8_PULLUP FILAMENT_CHANGE_RESUME_ON_INSERT PAUSE_REHEAT_FAST_RESUME \
LCD_BED_TRAMMING BED_TRAMMING_USE_PROBE
opt_disable CONFIGURE_FILAMENT_CHANGE
exec_test $1 $2 "BigTreeTech GTR | 8 Extruders | Auto-Fan | Mixed TMC Drivers | Runout Sensors w/ distinct states" "$3"
restore_configs

View file

@ -259,7 +259,8 @@ MIXING_EXTRUDER = build_src_filter=+<src/feature/mixing.c
HAS_PRUSA_MMU1 = build_src_filter=+<src/feature/mmu/mmu.cpp>
HAS_PRUSA_MMU2 = build_src_filter=+<src/feature/mmu/mmu2.cpp> +<src/gcode/feature/prusa_MMU2>
PASSWORD_FEATURE = build_src_filter=+<src/feature/password> +<src/gcode/feature/password>
ADVANCED_PAUSE_FEATURE = build_src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp> +<src/gcode/feature/pause/M603.cpp>
ADVANCED_PAUSE_FEATURE = build_src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp>
CONFIGURE_FILAMENT_CHANGE = build_src_filter=+<src/gcode/feature/pause/M603.cpp>
PSU_CONTROL = build_src_filter=+<src/feature/power.cpp>
HAS_POWER_MONITOR = build_src_filter=+<src/feature/power_monitor.cpp> +<src/gcode/feature/power_monitor>
POWER_LOSS_RECOVERY = build_src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss>