Misc adjustments

This commit is contained in:
Scott Lahteine 2020-10-27 23:51:51 -05:00
parent 19ae18979e
commit ca34edc5b0
5 changed files with 27 additions and 25 deletions

View file

@ -121,7 +121,7 @@ char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE];
#endif #endif
; ;
#endif // MMU2_MENUS #endif
MMU2::MMU2() { MMU2::MMU2() {
rx_buffer[0] = '\0'; rx_buffer[0] = '\0';
@ -755,7 +755,7 @@ static void mmu2_not_responding() {
set_runout_valid(true); set_runout_valid(true);
#endif #endif
} }
#endif // HAS_PRUSA_MMU2S #endif // HAS_PRUSA_MMU2S

View file

@ -40,7 +40,7 @@
* F[units/min] Set the movement feedrate * F[units/min] Set the movement feedrate
* S1 Don't move the tool in XY after change * S1 Don't move the tool in XY after change
* *
* For PRUSA_MMU2/PRUSA_MMU2S/SMUFF_EMU_MMU2PRUSA_MMU2S: * For PRUSA_MMU2(S) and SMUFF_EMU_MMU2(S)
* T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels. * T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically. * T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load. * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.

View file

@ -46,7 +46,7 @@
#define MACHINE_CAN_PAUSE 1 #define MACHINE_CAN_PAUSE 1
#endif #endif
#if HAS_PRUSA_MMU2 #if ENABLED(MMU2_MENUS)
#include "../../lcd/menu/menu_mmu2.h" #include "../../lcd/menu/menu_mmu2.h"
#endif #endif

View file

@ -28,9 +28,6 @@
#include "menu_mmu2.h" #include "menu_mmu2.h"
#include "menu_item.h" #include "menu_item.h"
uint8_t currentTool;
bool mmuMenuWait;
// //
// Load Filament // Load Filament
// //
@ -123,9 +120,12 @@ void menu_mmu2() {
// T* Choose Filament // T* Choose Filament
// //
inline void action_mmu2_choose(const uint8_t tool) { uint8_t feeder_index;
currentTool = tool; bool wait_for_mmu_menu;
mmuMenuWait = false;
inline void action_mmu2_chosen(const uint8_t index) {
feeder_index = index;
wait_for_mmu_menu = false;
} }
void menu_mmu2_choose_filament() { void menu_mmu2_choose_filament() {
@ -133,7 +133,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, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); }); LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }
@ -142,32 +142,32 @@ void menu_mmu2_choose_filament() {
// //
void menu_mmu2_pause() { void menu_mmu2_pause() {
currentTool = mmu2.get_current_tool(); feeder_index = mmu2.get_current_tool();
START_MENU(); START_MENU();
#if LCD_HEIGHT > 2 #if LCD_HEIGHT > 2
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT);
#endif #endif
ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; }); ACTION_ITEM(MSG_MMU2_RESUME, []{ wait_for_mmu_menu = false; });
ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); }); ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); });
ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(currentTool); }); ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(feeder_index); });
ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(currentTool); }); ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(feeder_index); });
END_MENU(); END_MENU();
} }
void mmu2_M600() { void mmu2_M600() {
ui.defer_status_screen(); ui.defer_status_screen();
ui.goto_screen(menu_mmu2_pause); ui.goto_screen(menu_mmu2_pause);
mmuMenuWait = true; wait_for_mmu_menu = true;
while (mmuMenuWait) idle(); while (wait_for_mmu_menu) idle();
} }
uint8_t mmu2_choose_filament() { uint8_t mmu2_choose_filament() {
ui.defer_status_screen(); ui.defer_status_screen();
ui.goto_screen(menu_mmu2_choose_filament); ui.goto_screen(menu_mmu2_choose_filament);
mmuMenuWait = true; wait_for_mmu_menu = true;
while (mmuMenuWait) idle(); while (wait_for_mmu_menu) idle();
ui.return_to_status(); ui.return_to_status();
return currentTool; return feeder_index;
} }
#endif // HAS_LCD_MENU && MMU2_MENUS #endif // HAS_LCD_MENU && MMU2_MENUS

View file

@ -418,16 +418,18 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0)
#endif #endif
#elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#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)
#elif HAS_PRUSA_MMU2 #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)
#elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#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)
#elif E_STEPPERS > 1 #elif E_STEPPERS > 1
#if E_STEPPERS > 7 #if E_STEPPERS > 7