Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and eoyilmaz committed Jun 26, 2024
1 parent 49c7b41 commit ae92c63
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Marlin/src/feature/mmu3/mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace MMU3 {
void MMU3::resetX0() { logic.ResetMMU(); } // Send soft reset
void MMU3::resetX42() { logic.ResetMMU(42); }

void MMU3::triggerResetPin() { reset(); }
void MMU3::triggerResetPin() { power_reset(); }

void MMU3::powerCycle() {
// cut the power to the MMU and after a while restore it
Expand Down Expand Up @@ -277,7 +277,7 @@ namespace MMU3 {
//&& printJobOngoing()
&& parser.codenum != 600
&& TERN1(HAS_LEVELING, planner.leveling_active)
&& all_axes_homed()
&& xy_are_trusted()
&& e_active()
#if ENABLED(MMU_SPOOL_JOIN_CONSUMES_ALL_FILAMENT)
&& runout.enabled // to prevent M600 to be triggered during M600 AUTO
Expand Down Expand Up @@ -724,7 +724,7 @@ namespace MMU3 {
// right after the current one is solved.

// Move XY aside
if (all_axes_homed()) nozzle_park();
if (xy_are_trusted()) nozzle_park();
}
}
}
Expand All @@ -746,7 +746,7 @@ namespace MMU3 {
ReportErrorHookSensorLineRender();
waitForHotendTargetTemp(100, [] {
marlin_manage_inactivity(true);
mmu_loop_inner(false);
mmu3.mmu_loop_inner(false);
ReportErrorHookDynamicRender();
});
ScreenUpdateEnable(); // temporary hack to stop this locking the printer...
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu3/mmu2_error_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ namespace MMU3 {
return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR);
}

uint16_t PrusaErrorCode(const uint8_t i) { return pgm_read_word(&errorCodes[i]); }
uint16_t PrusaErrorCode(const uint8_t i) { return (uint16_t)pgm_read_word(&errorCodes[i]); }

FSTR_P const PrusaErrorTitle(const uint8_t i) { return (FSTR_P const)pgm_read_ptr(&errorTitles[i]); }
FSTR_P const PrusaErrorDesc(const uint8_t i) { return (FSTR_P const)pgm_read_ptr(&errorDescs[i]); }
Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/feature/mmu3/mmu2_marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

#include "../../inc/MarlinConfig.h"

namespace MMU3 {
namespace MMU3 {

// This interface separates Marlin1/Marlin2 from the MMU top logic layer.
// - Unify implementation among MK3 and Buddy FW
// - Enable unit testing of MMU top layer
Expand Down Expand Up @@ -68,6 +69,6 @@
void Enable_E0();
void Disable_E0();

bool all_axes_homed();
bool xy_are_trusted();

} // MMU3
} // MMU3
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu3/mmu2_marlin1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ namespace MMU3 {
stepper.disable_extruder(TERN_(HAS_EXTRUDERS, 0));
}

bool all_axes_homed() {
bool xy_are_trusted() {
return axis_is_trusted(X_AXIS) && axis_is_trusted(Y_AXIS);
}

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/mmu3/mmu2_power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ void power_on() {
#if PIN_EXISTS(MMU2_RST)
OUT_WRITE(MMU2_RST_PIN, HIGH);
#endif
reset();
power_reset();
}

void power_off() {}

void reset() {
void power_reset() {
#if PIN_EXISTS(MMU2_RST) // HW - pulse reset pin
WRITE(MMU2_RST_PIN, LOW);
safe_delay(100);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu3/mmu2_power.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ void power_on();

void power_off();

void reset();
void power_reset();

} // MMU3
2 changes: 1 addition & 1 deletion Marlin/src/feature/mmu3/mmu2_protocol_logic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ namespace MMU3 {
}

void ProtocolLogic::home(uint8_t mode) {
PlanGenericRequest(RequestMsg(RequestMsgCodes::home, mode));
PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode));
}

void ProtocolLogic::readRegister(uint8_t address) {
Expand Down
6 changes: 5 additions & 1 deletion Marlin/src/gcode/feature/prusa_MMU2/M403.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ void GcodeSuite::M403() {
type = parser.intval('F', -1);

if (WITHIN(index, 0, EXTRUDERS - 1) && WITHIN(type, 0, 2))
mmu2.set_filament_type(index, type);
#if HAS_PRUSA_MMU3
mmu3.set_filament_type(index, type);
#else
mmu2.set_filament_type(index, type);
#endif
else
SERIAL_ECHO_MSG("M403 - bad arguments.");
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/e3v2/proui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ void dwinPrintFinished() {
// Print was aborted
void dwinPrintAborted() {
#ifndef EVENT_GCODE_SD_ABORT
if (all_axes_homed()) {
if (ExtUI::isMachineHomed()) {
queue.inject(
#if ENABLED(NOZZLE_PARK_FEATURE)
F("G27")
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/menu/menu_mmu2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void _mmu2_eject_filament(uint8_t index) {
ui.reset_status();
ui.return_to_status();
ui.status_printf(0, GET_TEXT_F(MSG_MMU2_EJECTING_FILAMENT), int(index + 1));
if (mmu2.eject_filament(index, true)) ui.reset_status();
if (mmu3.eject_filament(index, true)) ui.reset_status();
}

void _mmu2_cut_filament(uint8_t index) {
Expand All @@ -101,7 +101,7 @@ void action_mmu2_unload_filament() {
LCD_MESSAGE(MSG_MMU2_UNLOADING_FILAMENT);
while (!TERN(HAS_PRUSA_MMU3, mmu3.unload(), mmu2.unload())) {
safe_delay(50);
TERN(HAS_PRUSA_MMU3, mmu3.marlin_idle(true), idle());
TERN(HAS_PRUSA_MMU3, MMU3::marlin_idle(true), idle());
}
ui.reset_status();
}
Expand Down Expand Up @@ -309,7 +309,7 @@ void menu_mmu2() {
EDIT_ITEM(bool, MSG_MMU_CUTTER, &cutter_enabled, []{
menu_mmu3_cutter_set_mode((uint8_t)!editable.state);
});
if (!busy && mmu3.cutter_enabled() && mmu3.mmu_hw_enabled) {
if (!busy && MMU3::cutter_enabled() && mmu3.mmu_hw_enabled) {
SUBMENU(MSG_MMU2_CUT_FILAMENT, menu_mmu3_cut_filament);
}

Expand Down Expand Up @@ -350,7 +350,7 @@ void menu_mmu2_choose_filament() {
//

void menu_mmu2_pause() {
feeder_index = mmu2.get_current_tool();
feeder_index = mmu3.get_current_tool();
START_MENU();
#if LCD_HEIGHT > 2
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT);
Expand Down

0 comments on commit ae92c63

Please sign in to comment.