Set HAS_PRUSA_MMU2 for S also

This commit is contained in:
Scott Lahteine 2020-10-27 22:38:34 -05:00
parent 11ab6da975
commit 0327ba1858
15 changed files with 27 additions and 26 deletions

View file

@ -3525,7 +3525,7 @@
//#define E_MUX0_PIN 40 // Always Required //#define E_MUX0_PIN 40 // Always Required
//#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs //#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs
//#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
// Serial port used for communication with MMU2. // Serial port used for communication with MMU2.
// For AVR enable the UART port used for the MMU. (e.g., mmuSerial) // For AVR enable the UART port used for the MMU. (e.g., mmuSerial)
// For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2)
@ -3611,7 +3611,7 @@
//#define MMU2_DEBUG // Write debug info to serial output //#define MMU2_DEBUG // Write debug info to serial output
#endif // HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #endif // HAS_PRUSA_MMU2
/** /**
* Advanced Print Counter settings * Advanced Print Counter settings

View file

@ -213,7 +213,7 @@
#include "feature/controllerfan.h" #include "feature/controllerfan.h"
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "feature/mmu/mmu2.h" #include "feature/mmu/mmu2.h"
#endif #endif
@ -772,7 +772,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
#endif #endif
// Update the Průša MMU2 // Update the Průša MMU2
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
mmu2.mmu_loop(); mmu2.mmu_loop();
#endif #endif
@ -1262,7 +1262,7 @@ void setup() {
SETUP_RUN(test_tmc_connection(true, true, true, true)); SETUP_RUN(test_tmc_connection(true, true, true, true));
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
SETUP_RUN(mmu2.init()); SETUP_RUN(mmu2.init());
#endif #endif

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "mmu2.h" #include "mmu2.h"
#include "../../lcd/menu/menu_mmu2.h" #include "../../lcd/menu/menu_mmu2.h"
@ -162,7 +162,7 @@ uint8_t MMU2::get_current_tool() {
return extruder == MMU2_NO_TOOL ? -1 : extruder; return extruder == MMU2_NO_TOOL ? -1 : extruder;
} }
#if HAS_PRUSA_MMU2S || ENABLED(MMU_EXTRUDER_SENSOR) #if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR)
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE) #define FILAMENT_PRESENT() (READ(FIL_RUNOUT_PIN) != FIL_RUNOUT_STATE)
#endif #endif
@ -681,7 +681,7 @@ static void mmu2_not_responding() {
mmu_idl_sens = 0; mmu_idl_sens = 0;
} }
#else // !HAS_PRUSA_MMU2S && DISABLED(MMU_EXTRUDER_SENSOR) #else // !HAS_PRUSA_MMU2S && !MMU_EXTRUDER_SENSOR
/** /**
* Handle tool change * Handle tool change
@ -1064,4 +1064,4 @@ void MMU2::filament_runout() {
#endif // HAS_LCD_MENU && MMU2_MENUS #endif // HAS_LCD_MENU && MMU2_MENUS
#endif // HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #endif // HAS_PRUSA_MMU2

View file

@ -37,7 +37,7 @@
*/ */
void GcodeSuite::M220() { void GcodeSuite::M220() {
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
static int16_t backup_feedrate_percentage = 100; static int16_t backup_feedrate_percentage = 100;
if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;

View file

@ -27,7 +27,7 @@
#include "../../module/motion.h" #include "../../module/motion.h"
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "../../feature/mmu/mmu2.h" #include "../../feature/mmu/mmu2.h"
#endif #endif
@ -54,7 +54,7 @@ void GcodeSuite::T(const int8_t tool_index) {
// Count this command as movement / activity // Count this command as movement / activity
reset_stepper_timeout(); reset_stepper_timeout();
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
if (parser.string_arg) { if (parser.string_arg) {
mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc
return; return;

View file

@ -38,7 +38,7 @@
#include "../../../lcd/marlinui.h" #include "../../../lcd/marlinui.h"
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "../../../feature/mmu/mmu2.h" #include "../../../feature/mmu/mmu2.h"
#endif #endif
@ -98,7 +98,7 @@ void GcodeSuite::M701() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Load filament // Load filament
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
mmu2.load_filament_to_nozzle(target_extruder); mmu2.load_filament_to_nozzle(target_extruder);
#else #else
constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH, constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH,
@ -198,7 +198,7 @@ void GcodeSuite::M702() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Unload filament // Unload filament
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
mmu2.unload(); mmu2.unload();
#else #else
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS) #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS)

View file

@ -22,7 +22,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "../../gcode.h" #include "../../gcode.h"
#include "../../../feature/mmu/mmu2.h" #include "../../../feature/mmu/mmu2.h"
@ -46,4 +46,4 @@ void GcodeSuite::M403() {
SERIAL_ECHO_MSG("M403 - bad arguments."); SERIAL_ECHO_MSG("M403 - bad arguments.");
} }
#endif // HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #endif // HAS_PRUSA_MMU2

View file

@ -699,7 +699,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 402: M402(); break; // M402: Stow probe case 402: M402(); break; // M402: Stow probe
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
case 403: M403(); break; case 403: M403(); break;
#endif #endif

View file

@ -735,7 +735,7 @@ private:
static void M402(); static void M402();
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
static void M403(); static void M403();
#endif #endif

View file

@ -155,7 +155,7 @@ void GCodeParser::parse(char *p) {
// Skip spaces to get the numeric part // Skip spaces to get the numeric part
while (*p == ' ') p++; while (*p == ' ') p++;
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
if (letter == 'T') { if (letter == 'T') {
// check for special MMU2 T?/Tx/Tc commands // check for special MMU2 T?/Tx/Tc commands
if (*p == '?' || *p == 'x' || *p == 'c') { if (*p == '?' || *p == 'x' || *p == 'c') {

View file

@ -511,6 +511,7 @@
#elif MMU_MODEL % 10 == PRUSA_MMU2 #elif MMU_MODEL % 10 == PRUSA_MMU2
#define HAS_PRUSA_MMU2 1 #define HAS_PRUSA_MMU2 1
#elif MMU_MODEL % 10 == PRUSA_MMU2S #elif MMU_MODEL % 10 == PRUSA_MMU2S
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1 #define HAS_PRUSA_MMU2S 1
#endif #endif
#if MMU_MODEL >= SMUFF_EMU_MMU2 #if MMU_MODEL >= SMUFF_EMU_MMU2
@ -566,7 +567,7 @@
#elif ENABLED(SWITCHING_TOOLHEAD) #elif ENABLED(SWITCHING_TOOLHEAD)
#define E_STEPPERS EXTRUDERS #define E_STEPPERS EXTRUDERS
#define E_MANUAL EXTRUDERS #define E_MANUAL EXTRUDERS
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
#define E_STEPPERS 1 #define E_STEPPERS 1
#endif #endif

View file

@ -2963,7 +2963,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
*/ */
#if HAS_SMUFF && EXTRUDERS > 15 #if HAS_SMUFF && EXTRUDERS > 15
#error "Too many extruders for SMUFF_EMU_MMU2(S). (15 maximum)." #error "Too many extruders for SMUFF_EMU_MMU2(S). (15 maximum)."
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
#if EXTRUDERS != 5 #if EXTRUDERS != 5
#error "PRUSA_MMU2 / PRUSA_MMU2S requires EXTRUDERS = 5." #error "PRUSA_MMU2 / PRUSA_MMU2S requires EXTRUDERS = 5."
#elif DISABLED(NOZZLE_PARK_FEATURE) #elif DISABLED(NOZZLE_PARK_FEATURE)

View file

@ -46,7 +46,7 @@
#define MACHINE_CAN_PAUSE 1 #define MACHINE_CAN_PAUSE 1
#endif #endif
#if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #if HAS_PRUSA_MMU2
#include "../../lcd/menu/menu_mmu2.h" #include "../../lcd/menu/menu_mmu2.h"
#endif #endif

View file

@ -423,7 +423,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0)
#define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0)
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)

View file

@ -87,7 +87,7 @@
#if HAS_PRUSA_MMU1 #if HAS_PRUSA_MMU1
#include "../feature/mmu/mmu.h" #include "../feature/mmu/mmu.h"
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
#include "../feature/mmu/mmu2.h" #include "../feature/mmu/mmu2.h"
#endif #endif
@ -861,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
mixer.T(new_tool); mixer.T(new_tool);
#endif #endif
#elif HAS_PRUSA_MMU2 || HAS_PRUSA_MMU2S #elif HAS_PRUSA_MMU2
UNUSED(no_move); UNUSED(no_move);