Browse Source

🧑‍💻 EXTRUDER_LOOP macro

FB4S_WIFI
Scott Lahteine 3 years ago
committed by Scott Lahteine
parent
commit
4a8b99d505
  1. 20
      Marlin/src/feature/fwretract.cpp
  2. 2
      Marlin/src/feature/fwretract.h
  3. 10
      Marlin/src/feature/powerloss.cpp
  4. 6
      Marlin/src/gcode/config/M200-M205.cpp
  5. 6
      Marlin/src/gcode/control/M17_M18_M84.cpp
  6. 18
      Marlin/src/gcode/feature/advance/M900.cpp
  7. 2
      Marlin/src/gcode/feature/pause/M603.cpp
  8. 1
      Marlin/src/inc/Conditionals_LCD.h
  9. 20
      Marlin/src/lcd/menu/menu_advanced.cpp
  10. 6
      Marlin/src/lcd/menu/menu_configuration.cpp
  11. 10
      Marlin/src/lcd/menu/menu_mmu2.cpp
  12. 8
      Marlin/src/lcd/menu/menu_tune.cpp
  13. 2
      Marlin/src/module/planner.cpp
  14. 4
      Marlin/src/module/planner.h
  15. 8
      Marlin/src/module/settings.cpp

20
Marlin/src/feature/fwretract.cpp

@ -73,10 +73,10 @@ void FWRetract::reset() {
settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP; settings.swap_retract_recover_feedrate_mm_s = RETRACT_RECOVER_FEEDRATE_SWAP;
current_hop = 0.0; current_hop = 0.0;
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
retracted[i] = false; retracted[e] = false;
E_TERN_(retracted_swap[i] = false); E_TERN_(retracted_swap[e] = false);
current_retract[i] = 0.0; current_retract[e] = 0.0;
} }
} }
@ -111,10 +111,10 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
" swapping ", swapping, " swapping ", swapping,
" active extruder ", active_extruder " active extruder ", active_extruder
); );
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i])); SERIAL_ECHOLNPGM("retracted[", e, "] ", AS_DIGIT(retracted[e]));
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i])); SERIAL_ECHOLNPGM("retracted_swap[", e, "] ", AS_DIGIT(retracted_swap[e]));
#endif #endif
} }
SERIAL_ECHOLNPGM("current_position.z ", current_position.z); SERIAL_ECHOLNPGM("current_position.z ", current_position.z);
@ -184,10 +184,10 @@ void FWRetract::retract(const bool retracting E_OPTARG(bool swapping/*=false*/))
SERIAL_ECHOLNPGM("retracting ", AS_DIGIT(retracting)); SERIAL_ECHOLNPGM("retracting ", AS_DIGIT(retracting));
SERIAL_ECHOLNPGM("swapping ", AS_DIGIT(swapping)); SERIAL_ECHOLNPGM("swapping ", AS_DIGIT(swapping));
SERIAL_ECHOLNPGM("active_extruder ", active_extruder); SERIAL_ECHOLNPGM("active_extruder ", active_extruder);
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
SERIAL_ECHOLNPGM("retracted[", i, "] ", AS_DIGIT(retracted[i])); SERIAL_ECHOLNPGM("retracted[", e, "] ", AS_DIGIT(retracted[e]));
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
SERIAL_ECHOLNPGM("retracted_swap[", i, "] ", AS_DIGIT(retracted_swap[i])); SERIAL_ECHOLNPGM("retracted_swap[", e, "] ", AS_DIGIT(retracted_swap[e]));
#endif #endif
} }
SERIAL_ECHOLNPGM("current_position.z ", current_position.z); SERIAL_ECHOLNPGM("current_position.z ", current_position.z);

2
Marlin/src/feature/fwretract.h

@ -64,7 +64,7 @@ public:
static void reset(); static void reset();
static void refresh_autoretract() { static void refresh_autoretract() {
LOOP_L_N(i, EXTRUDERS) retracted[i] = false; EXTRUDER_LOOP() retracted[e] = false;
} }
static void enable_autoretract(const bool enable) { static void enable_autoretract(const bool enable) {

10
Marlin/src/feature/powerloss.cpp

@ -196,7 +196,7 @@ void PrintJobRecovery::save(const bool force/*=false*/, const float zraise/*=POW
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
info.flag.volumetric_enabled = parser.volumetric_enabled; info.flag.volumetric_enabled = parser.volumetric_enabled;
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
for (int8_t e = 0; e < EXTRUDERS; e++) info.filament_size[e] = planner.filament_size[e]; EXTRUDER_LOOP() info.filament_size[e] = planner.filament_size[e];
#else #else
if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder]; if (parser.volumetric_enabled) info.filament_size[0] = planner.filament_size[active_extruder];
#endif #endif
@ -461,7 +461,7 @@ void PrintJobRecovery::resume() {
// Recover volumetric extrusion state // Recover volumetric extrusion state
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
for (int8_t e = 0; e < EXTRUDERS; e++) { EXTRUDER_LOOP() {
sprintf_P(cmd, PSTR("M200T%iD%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1)); sprintf_P(cmd, PSTR("M200T%iD%s"), e, dtostrf(info.filament_size[e], 1, 3, str_1));
gcode.process_subcommands_now(cmd); gcode.process_subcommands_now(cmd);
} }
@ -511,7 +511,7 @@ void PrintJobRecovery::resume() {
// Restore retract and hop state from an active `G10` command // Restore retract and hop state from an active `G10` command
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
if (info.retract[e] != 0.0) { if (info.retract[e] != 0.0) {
fwretract.current_retract[e] = info.retract[e]; fwretract.current_retract[e] = info.retract[e];
fwretract.retracted[e] = true; fwretract.retracted[e] = true;
@ -634,7 +634,7 @@ void PrintJobRecovery::resume() {
#if DISABLED(NO_VOLUMETRICS) #if DISABLED(NO_VOLUMETRICS)
DEBUG_ECHOPGM("filament_size:"); DEBUG_ECHOPGM("filament_size:");
LOOP_L_N(i, EXTRUDERS) DEBUG_ECHOLNPGM(" ", info.filament_size[i]); EXTRUDER_LOOP() DEBUG_ECHOLNPGM(" ", info.filament_size[e]);
DEBUG_EOL(); DEBUG_EOL();
#endif #endif
@ -666,7 +666,7 @@ void PrintJobRecovery::resume() {
#if ENABLED(FWRETRACT) #if ENABLED(FWRETRACT)
DEBUG_ECHOPGM("retract: "); DEBUG_ECHOPGM("retract: ");
for (int8_t e = 0; e < EXTRUDERS; e++) { EXTRUDER_LOOP() {
DEBUG_ECHO(info.retract[e]); DEBUG_ECHO(info.retract[e]);
if (e < EXTRUDERS - 1) DEBUG_CHAR(','); if (e < EXTRUDERS - 1) DEBUG_CHAR(',');
} }

6
Marlin/src/gcode/config/M200-M205.cpp

@ -93,12 +93,12 @@
} }
#else #else
SERIAL_ECHOLNPGM(" M200 S", parser.volumetric_enabled); SERIAL_ECHOLNPGM(" M200 S", parser.volumetric_enabled);
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
report_echo_start(forReplay); report_echo_start(forReplay);
SERIAL_ECHOLNPGM( SERIAL_ECHOLNPGM(
" M200 T", i, " D", LINEAR_UNIT(planner.filament_size[i]) " M200 T", e, " D", LINEAR_UNIT(planner.filament_size[e])
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
, " L", LINEAR_UNIT(planner.volumetric_extruder_limit[i]) , " L", LINEAR_UNIT(planner.volumetric_extruder_limit[e])
#endif #endif
); );
} }

6
Marlin/src/gcode/control/M17_M18_M84.cpp

@ -77,7 +77,7 @@ void do_enable(const axis_flags_t to_enable) {
} }
} }
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); const uint8_t a = INDEX_OF_AXIS(E_AXIS, e);
if (TEST(shall_enable, a)) { if (TEST(shall_enable, a)) {
stepper.ENABLE_EXTRUDER(e); stepper.ENABLE_EXTRUDER(e);
@ -161,7 +161,7 @@ void try_to_disable(const axis_flags_t to_disable) {
DEBUG_ECHOLNPGM(" ... still_enabled=", hex_word(still_enabled)); DEBUG_ECHOLNPGM(" ... still_enabled=", hex_word(still_enabled));
} }
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); const uint8_t a = INDEX_OF_AXIS(E_AXIS, e);
if (TEST(to_disable.bits, a)) { if (TEST(to_disable.bits, a)) {
DEBUG_ECHOPGM("Try to disable E", AS_DIGIT(e), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... "); DEBUG_ECHOPGM("Try to disable E", AS_DIGIT(e), " (", a, ") with overlap ", hex_word(enable_overlap[a]), " ... ");
@ -194,7 +194,7 @@ void try_to_disable(const axis_flags_t to_disable) {
} }
} }
#if HAS_EXTRUDERS #if HAS_EXTRUDERS
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
const uint8_t a = INDEX_OF_AXIS(E_AXIS, e); const uint8_t a = INDEX_OF_AXIS(E_AXIS, e);
if (TEST(still_enabled, a)) { if (TEST(still_enabled, a)) {
SERIAL_CHAR('E', '0' + e); SERIAL_CHAR('E', '0' + e);

18
Marlin/src/gcode/feature/advance/M900.cpp

@ -117,10 +117,10 @@ void GcodeSuite::M900() {
#if EXTRUDERS < 2 #if EXTRUDERS < 2
SERIAL_ECHOLNPGM("Advance S", new_slot, " K", kref, "(S", !new_slot, " K", lref, ")"); SERIAL_ECHOLNPGM("Advance S", new_slot, " K", kref, "(S", !new_slot, " K", lref, ")");
#else #else
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
const bool slot = TEST(lin_adv_slot, i); const bool slot = TEST(lin_adv_slot, e);
SERIAL_ECHOLNPGM("Advance T", i, " S", slot, " K", planner.extruder_advance_K[i], SERIAL_ECHOLNPGM("Advance T", e, " S", slot, " K", planner.extruder_advance_K[e],
"(S", !slot, " K", other_extruder_advance_K[i], ")"); "(S", !slot, " K", other_extruder_advance_K[e], ")");
SERIAL_EOL(); SERIAL_EOL();
} }
#endif #endif
@ -132,9 +132,9 @@ void GcodeSuite::M900() {
SERIAL_ECHOLNPGM("Advance K=", planner.extruder_advance_K[0]); SERIAL_ECHOLNPGM("Advance K=", planner.extruder_advance_K[0]);
#else #else
SERIAL_ECHOPGM("Advance K"); SERIAL_ECHOPGM("Advance K");
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
SERIAL_CHAR(' ', '0' + i, ':'); SERIAL_CHAR(' ', '0' + e, ':');
SERIAL_DECIMAL(planner.extruder_advance_K[i]); SERIAL_DECIMAL(planner.extruder_advance_K[e]);
} }
SERIAL_EOL(); SERIAL_EOL();
#endif #endif
@ -150,9 +150,9 @@ void GcodeSuite::M900_report(const bool forReplay/*=true*/) {
report_echo_start(forReplay); report_echo_start(forReplay);
SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]); SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]);
#else #else
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
report_echo_start(forReplay); report_echo_start(forReplay);
SERIAL_ECHOLNPGM(" M900 T", i, " K", planner.extruder_advance_K[i]); SERIAL_ECHOLNPGM(" M900 T", e, " K", planner.extruder_advance_K[e]);
} }
#endif #endif
} }

2
Marlin/src/gcode/feature/pause/M603.cpp

@ -72,7 +72,7 @@ void GcodeSuite::M603_report(const bool forReplay/*=true*/) {
SERIAL_ECHOPGM(" M603 L", LINEAR_UNIT(fc_settings[0].load_length), " U", LINEAR_UNIT(fc_settings[0].unload_length), " ;"); SERIAL_ECHOPGM(" M603 L", LINEAR_UNIT(fc_settings[0].load_length), " U", LINEAR_UNIT(fc_settings[0].unload_length), " ;");
say_units(); say_units();
#else #else
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
report_echo_start(forReplay); report_echo_start(forReplay);
SERIAL_ECHOPGM(" M603 T", e, " L", LINEAR_UNIT(fc_settings[e].load_length), " U", LINEAR_UNIT(fc_settings[e].unload_length), " ;"); SERIAL_ECHOPGM(" M603 T", e, " L", LINEAR_UNIT(fc_settings[e].load_length), " U", LINEAR_UNIT(fc_settings[e].unload_length), " ;");
say_units(); say_units();

1
Marlin/src/inc/Conditionals_LCD.h

@ -749,6 +749,7 @@
#endif #endif
// Helper macros for extruder and hotend arrays // Helper macros for extruder and hotend arrays
#define EXTRUDER_LOOP() for (int8_t e = 0; e < EXTRUDERS; e++)
#define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++)
#define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V)
#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1) #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_N_1(EXTRUDERS, v1)

20
Marlin/src/lcd/menu/menu_advanced.cpp

@ -109,8 +109,8 @@ void menu_backlash();
#if EXTRUDERS == 1 #if EXTRUDERS == 1
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
#elif HAS_MULTI_EXTRUDER #elif HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
#endif #endif
#endif #endif
@ -120,16 +120,16 @@ void menu_backlash();
#if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT) #if ENABLED(VOLUMETRIC_EXTRUDER_LIMIT)
EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits); EDIT_ITEM_FAST(float42_52, MSG_VOLUMETRIC_LIMIT, &planner.volumetric_extruder_limit[active_extruder], 0.0f, 20.0f, planner.calculate_volumetric_extruder_limits);
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_FAST_N(float42_52, n, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[n], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits); EDIT_ITEM_FAST_N(float42_52, e, MSG_VOLUMETRIC_LIMIT_E, &planner.volumetric_extruder_limit[e], 0.0f, 20.00f, planner.calculate_volumetric_extruder_limits);
#endif #endif
#endif #endif
if (parser.volumetric_enabled) { if (parser.volumetric_enabled) {
EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); EDIT_ITEM_FAST(float43, MSG_FILAMENT_DIAM, &planner.filament_size[active_extruder], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_FAST_N(float43, n, MSG_FILAMENT_DIAM_E, &planner.filament_size[n], 1.5f, 3.25f, planner.calculate_volumetric_multipliers); EDIT_ITEM_FAST_N(float43, e, MSG_FILAMENT_DIAM_E, &planner.filament_size[e], 1.5f, 3.25f, planner.calculate_volumetric_multipliers);
#endif #endif
} }
#endif #endif
@ -139,14 +139,14 @@ void menu_backlash();
EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength); EDIT_ITEM_FAST(float4, MSG_FILAMENT_UNLOAD, &fc_settings[active_extruder].unload_length, 0, extrude_maxlength);
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTUNLOAD_E, &fc_settings[n].unload_length, 0, extrude_maxlength); EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTUNLOAD_E, &fc_settings[e].unload_length, 0, extrude_maxlength);
#endif #endif
EDIT_ITEM_FAST(float4, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength); EDIT_ITEM_FAST(float4, MSG_FILAMENT_LOAD, &fc_settings[active_extruder].load_length, 0, extrude_maxlength);
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_FAST_N(float4, n, MSG_FILAMENTLOAD_E, &fc_settings[n].load_length, 0, extrude_maxlength); EDIT_ITEM_FAST_N(float4, e, MSG_FILAMENTLOAD_E, &fc_settings[e].load_length, 0, extrude_maxlength);
#endif #endif
#endif #endif

6
Marlin/src/lcd/menu/menu_configuration.cpp

@ -145,9 +145,9 @@ void menu_advanced_settings();
EDIT_ITEM(uint8, MSG_TOOL_MIGRATION_END, &migration.last, 0, EXTRUDERS - 1); EDIT_ITEM(uint8, MSG_TOOL_MIGRATION_END, &migration.last, 0, EXTRUDERS - 1);
// Migrate to a chosen extruder // Migrate to a chosen extruder
LOOP_L_N(s, EXTRUDERS) { EXTRUDER_LOOP() {
if (s != active_extruder) { if (e != active_extruder) {
ACTION_ITEM_N_P(s, msg_migrate, []{ ACTION_ITEM_N_P(e, msg_migrate, []{
char cmd[12]; char cmd[12];
sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex)); sprintf_P(cmd, PSTR("M217 T%i"), int(MenuItemBase::itemIndex));
queue.inject(cmd); queue.inject(cmd);

10
Marlin/src/lcd/menu/menu_mmu2.cpp

@ -48,7 +48,7 @@ void _mmu2_load_filament(uint8_t index) {
ui.reset_status(); ui.reset_status();
} }
void action_mmu2_load_all() { void action_mmu2_load_all() {
LOOP_L_N(i, EXTRUDERS) _mmu2_load_filament(i); EXTRUDER_LOOP() _mmu2_load_filament(e);
ui.return_to_status(); ui.return_to_status();
} }
@ -56,14 +56,14 @@ void menu_mmu2_load_filament() {
START_MENU(); START_MENU();
BACK_ITEM(MSG_MMU2_MENU); BACK_ITEM(MSG_MMU2_MENU);
ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all); ACTION_ITEM(MSG_MMU2_ALL, action_mmu2_load_all);
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); }); EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_load_filament(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }
void menu_mmu2_load_to_nozzle() { void menu_mmu2_load_to_nozzle() {
START_MENU(); START_MENU();
BACK_ITEM(MSG_MMU2_MENU); BACK_ITEM(MSG_MMU2_MENU);
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); }); EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_load_filament_to_nozzle(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }
@ -89,7 +89,7 @@ void action_mmu2_unload_filament() {
void menu_mmu2_eject_filament() { void menu_mmu2_eject_filament() {
START_MENU(); START_MENU();
BACK_ITEM(MSG_MMU2_MENU); BACK_ITEM(MSG_MMU2_MENU);
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); }); EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ _mmu2_eject_filament(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }
@ -130,7 +130,7 @@ void menu_mmu2_choose_filament() {
#if LCD_HEIGHT > 2 #if LCD_HEIGHT > 2
STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT); STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT);
#endif #endif
LOOP_L_N(i, EXTRUDERS) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); }); EXTRUDER_LOOP() ACTION_ITEM_N(e, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }

8
Marlin/src/lcd/menu/menu_tune.cpp

@ -199,8 +199,8 @@ void menu_tune() {
EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); }); EDIT_ITEM(int3, MSG_FLOW, &planner.flow_percentage[active_extruder], 10, 999, []{ planner.refresh_e_factor(active_extruder); });
// Flow En: // Flow En:
#if HAS_MULTI_EXTRUDER #if HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_N(int3, n, MSG_FLOW_N, &planner.flow_percentage[n], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); }); EDIT_ITEM_N(int3, e, MSG_FLOW_N, &planner.flow_percentage[e], 10, 999, []{ planner.refresh_e_factor(MenuItemBase::itemIndex); });
#endif #endif
#endif #endif
@ -211,8 +211,8 @@ void menu_tune() {
#if EXTRUDERS == 1 #if EXTRUDERS == 1
EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10); EDIT_ITEM(float42_52, MSG_ADVANCE_K, &planner.extruder_advance_K[0], 0, 10);
#elif HAS_MULTI_EXTRUDER #elif HAS_MULTI_EXTRUDER
LOOP_L_N(n, EXTRUDERS) EXTRUDER_LOOP()
EDIT_ITEM_N(float42_52, n, MSG_ADVANCE_K_E, &planner.extruder_advance_K[n], 0, 10); EDIT_ITEM_N(float42_52, e, MSG_ADVANCE_K_E, &planner.extruder_advance_K[e], 0, 10);
#endif #endif
#endif #endif

2
Marlin/src/module/planner.cpp

@ -1505,7 +1505,7 @@ void Planner::check_axes_activity() {
volumetric_extruder_feedrate_limit[e] = (lim && siz) ? lim / CIRCLE_AREA(siz * 0.5f) : 0; volumetric_extruder_feedrate_limit[e] = (lim && siz) ? lim / CIRCLE_AREA(siz * 0.5f) : 0;
} }
void Planner::calculate_volumetric_extruder_limits() { void Planner::calculate_volumetric_extruder_limits() {
LOOP_L_N(e, EXTRUDERS) calculate_volumetric_extruder_limit(e); EXTRUDER_LOOP() calculate_volumetric_extruder_limit(e);
} }
#endif #endif

4
Marlin/src/module/planner.h

@ -928,8 +928,8 @@ class Planner {
#if HAS_LINEAR_E_JERK #if HAS_LINEAR_E_JERK
FORCE_INLINE static void recalculate_max_e_jerk() { FORCE_INLINE static void recalculate_max_e_jerk() {
const float prop = junction_deviation_mm * SQRT(0.5) / (1.0f - SQRT(0.5)); const float prop = junction_deviation_mm * SQRT(0.5) / (1.0f - SQRT(0.5));
LOOP_L_N(i, EXTRUDERS) EXTRUDER_LOOP()
max_e_jerk[E_INDEX_N(i)] = SQRT(prop * settings.max_acceleration_mm_per_s2[E_INDEX_N(i)]); max_e_jerk[E_INDEX_N(e)] = SQRT(prop * settings.max_acceleration_mm_per_s2[E_INDEX_N(e)]);
} }
#endif #endif

8
Marlin/src/module/settings.cpp

@ -3138,9 +3138,9 @@ void MarlinSettings::reset() {
// //
#if ENABLED(LIN_ADVANCE) #if ENABLED(LIN_ADVANCE)
LOOP_L_N(i, EXTRUDERS) { EXTRUDER_LOOP() {
planner.extruder_advance_K[i] = LIN_ADVANCE_K; planner.extruder_advance_K[e] = LIN_ADVANCE_K;
TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[i] = LIN_ADVANCE_K); TERN_(EXTRA_LIN_ADVANCE_K, other_extruder_advance_K[e] = LIN_ADVANCE_K);
} }
#endif #endif
@ -3185,7 +3185,7 @@ void MarlinSettings::reset() {
// Advanced Pause filament load & unload lengths // Advanced Pause filament load & unload lengths
// //
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
LOOP_L_N(e, EXTRUDERS) { EXTRUDER_LOOP() {
fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH; fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH; fc_settings[e].load_length = FILAMENT_CHANGE_FAST_LOAD_LENGTH;
} }

Loading…
Cancel
Save