Skip to content

Commit

Permalink
⛙ Merge w/Marlin
Browse files Browse the repository at this point in the history
  • Loading branch information
classicrocker883 committed Nov 25, 2024
2 parents 25db3b2 + eaab2de commit dedbee0
Show file tree
Hide file tree
Showing 42 changed files with 444 additions and 105 deletions.
Binary file added Marlin/src/HAL/RP2040/docs/rp2040-datasheet.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
#define BOARD_MELLOW_FLY_E3_V2 5250 // Mellow Fly E3 V2 (STM32F407VG)
#define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6)
#define BOARD_XTLW_CLIMBER_8TH 5252 // XTLW Climber-8th (STM32F407VGT6)
#define BOARD_FLY_RRF_E3_V1 5253 // Fly RRF E3 V1.0 (STM32F407VG)

//
// Other ARM Cortex-M4
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ bool load_filament(const_float_t slow_load_length/*=0*/, const_float_t fast_load

while (wait_for_user) {
impatient_beep(max_beep_count);
#if ALL(FILAMENT_CHANGE_RESUME_ON_INSERT, FILAMENT_RUNOUT_SENSOR)
#if ALL(HAS_FILAMENT_SENSOR, FILAMENT_CHANGE_RESUME_ON_INSERT)
#if MULTI_FILAMENT_SENSOR
#define _CASE_INSERTED(N) case N-1: if (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) wait_for_user = false; break;
switch (active_extruder) {
REPEAT_1(NUM_RUNOUT_SENSORS, _CASE_INSERTED)
}
#else
if (READ(FIL_RUNOUT_PIN) != TERN(PROUI_EX, PRO_data.Runout_active_state, FIL_RUNOUT_STATE)) wait_for_user = false;
if (!FILAMENT_IS_OUT()) wait_for_user = false;
#endif
#endif
idle_no_sleep();
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/feature/runout.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
#define HAS_FILAMENT_SWITCH 1
#endif

#define FILAMENT_IS_OUT() (READ(FIL_RUNOUT_PIN) == TERN(PROUI_EX, PRO_data.Runout_active_state, FIL_RUNOUT_STATE))

typedef Flags<
#if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS
NUM_MOTION_SENSORS
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/host/M115.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void GcodeSuite::M115() {
cap_line(F("AUTOLEVEL"), ENABLED(HAS_AUTOLEVEL));

// RUNOUT (M412, M600)
cap_line(F("RUNOUT"), ENABLED(FILAMENT_RUNOUT_SENSOR));
cap_line(F("RUNOUT"), ENABLED(HAS_FILAMENT_SENSOR));

// Z_PROBE (G30)
cap_line(F("Z_PROBE"), ENABLED(HAS_BED_PROBE));
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/extui/anycubic_i3mega/anycubic_i3mega_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void AnycubicTFT::onSetup() {
delay_ms(10);

// Init the state of the key pins running on the TFT
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
SET_INPUT_PULLUP(FIL_RUNOUT1_PIN);
#endif

Expand Down Expand Up @@ -894,7 +894,7 @@ void AnycubicTFT::doSDCardStateCheck() {
}

void AnycubicTFT::doFilamentRunoutCheck() {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
/// NOTE: getFilamentRunoutState() only returns the runout state if the job is printing
// we want to actually check the status of the pin here, regardless of printstate
if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) {
Expand All @@ -909,7 +909,7 @@ void AnycubicTFT::doFilamentRunoutCheck() {
SENDLINE_DBG_PGM("J15", "TFT Serial Debug: Non blocking filament runout... J15");
}
}
#endif // FILAMENT_RUNOUT_SENSOR
#endif // HAS_FILAMENT_SENSOR
}

void AnycubicTFT::startPrint() {
Expand Down Expand Up @@ -939,7 +939,7 @@ void AnycubicTFT::pausePrint() {

void AnycubicTFT::resumePrint() {
#if HAS_MEDIA
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
if (READ(FIL_RUNOUT1_PIN) == FIL_RUNOUT1_STATE) {
DEBUG_ECHOLNPGM("TFT Serial Debug: Resume Print with filament sensor still tripped... ");

Expand Down
12 changes: 8 additions & 4 deletions Marlin/src/lcd/extui/anycubic_vyper/dgus_tft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#include "../../../feature/powerloss.h"
#endif

#if HAS_FILAMENT_SENSOR
#include "../../../feature/runout.h"
#endif

#define DEBUG_OUT ACDEBUGLEVEL
#include "../../../core/debug_out.h"

Expand Down Expand Up @@ -438,7 +442,7 @@ namespace Anycubic {
}
}

#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR

void DgusTFT::filamentRunout() {
#if ACDEBUG(AC_MARLIN)
Expand All @@ -453,7 +457,7 @@ namespace Anycubic {

pop_up_index = 15; // show filament lack.

if (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT_STATE) {
if (FILAMENT_IS_OUT()) {
playTune(FilamentOut);

feedrate_back = getFeedrate_percent();
Expand All @@ -466,7 +470,7 @@ namespace Anycubic {
}
}

#endif // FILAMENT_RUNOUT_SENSOR
#endif // HAS_FILAMENT_SENSOR

void DgusTFT::confirmationRequest(const char * const msg) {
// M108 continue
Expand Down Expand Up @@ -598,7 +602,7 @@ namespace Anycubic {
printer_state = AC_printer_stopping_from_media_remove;
}
else {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#if ACDEBUG(AC_MARLIN)
DEBUG_ECHOLNPGM("setFilamentRunoutState: ", __LINE__);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
# location: <https://www.gnu.org/licenses/>.

from __future__ import print_function
import argparse
import textwrap
import os
import zlib
import argparse, textwrap, os, zlib

def deflate(data):
return zlib.compress(data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

from __future__ import print_function
from PIL import Image
import argparse
import textwrap
import argparse, textwrap

def pack_rle(data):
"""Use run-length encoding to pack the bytes"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@

from __future__ import print_function
from PIL import Image
import argparse
import textwrap
import os
import sys
import zlib
import argparse, textwrap, os, sys, zlib

class WriteSource:
def __init__(self, mode):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# location: <https://www.gnu.org/licenses/>.

from __future__ import print_function
import argparse,re,sys
import argparse, re, sys

from html.parser import HTMLParser

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void AdvancedSettingsMenu::onRedraw(draw_mode_t what) {
#endif
.enabled(ENABLED(HAS_MULTI_HOTEND))
.tag(4) .button(OFFSETS_POS, GET_TEXT_F(MSG_OFFSETS_MENU))
.enabled(ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR))
.enabled(ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR))
.tag(11).button(FILAMENT_POS, GET_TEXT_F(MSG_FILAMENT))
.tag(12).button(ENDSTOPS_POS, GET_TEXT_F(MSG_LCD_ENDSTOPS))
.tag(15).button(DISPLAY_POS, GET_TEXT_F(MSG_DISPLAY_MENU))
Expand All @@ -122,29 +122,29 @@ bool AdvancedSettingsMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
#if HAS_BED_PROBE
case 2: GOTO_SCREEN(ZOffsetScreen); break;
case 2: GOTO_SCREEN(ZOffsetScreen); break;
#endif
case 3: GOTO_SCREEN(StepsScreen); break;
#if HAS_MULTI_HOTEND
case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
case 4: GOTO_SCREEN(NozzleOffsetScreen); break;
#endif
case 5: GOTO_SCREEN(MaxVelocityScreen); break;
case 6: GOTO_SCREEN(DefaultAccelerationScreen); break;
case 7: GOTO_SCREEN(TERN(HAS_JUNCTION_DEVIATION, JunctionDeviationScreen, JerkScreen)); break;
#if ENABLED(BACKLASH_GCODE)
case 8: GOTO_SCREEN(BacklashCompensationScreen); break;
case 8: GOTO_SCREEN(BacklashCompensationScreen); break;
#endif
case 9: GOTO_SCREEN(InterfaceSettingsScreen); LockScreen::check_passcode(); break;
case 10: GOTO_SCREEN(RestoreFailsafeDialogBox); LockScreen::check_passcode(); break;
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
case 11: GOTO_SCREEN(FilamentMenu); break;
#if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
case 11: GOTO_SCREEN(FilamentMenu); break;
#endif
case 12: GOTO_SCREEN(EndstopStatesScreen); break;
#if HAS_TRINAMIC_CONFIG
case 13: GOTO_SCREEN(StepperCurrentScreen); break;
case 13: GOTO_SCREEN(StepperCurrentScreen); break;
#endif
#if ENABLED(SENSORLESS_HOMING)
case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
case 14: GOTO_SCREEN(StepperBumpSensitivityScreen); break;
#endif
case 15: GOTO_SCREEN(DisplayTuningScreen); break;
case 16: GOTO_SCREEN(FlowPercentScreen); break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ void EndstopStatesScreen::onRedraw(draw_mode_t) {
#else
PIN_DISABLED(5, 3, PSTR(STR_Z_MIN), Z_MIN)
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT)
#if HAS_FILAMENT_SENSOR && PIN_EXISTS(FIL_RUNOUT)
PIN_ENABLED (1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT, FIL_RUNOUT1_STATE)
#else
PIN_DISABLED(1, 4, GET_TEXT_F(MSG_RUNOUT_1), FIL_RUNOUT)
#endif
#if ALL(HAS_MULTI_EXTRUDER, FILAMENT_RUNOUT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
#if ALL(HAS_MULTI_EXTRUDER, HAS_FILAMENT_SENSOR) && PIN_EXISTS(FIL_RUNOUT2)
PIN_ENABLED (3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2, FIL_RUNOUT2_STATE)
#else
PIN_DISABLED(3, 4, GET_TEXT_F(MSG_RUNOUT_2), FIL_RUNOUT2)
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/filament_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void FilamentMenu::onRedraw(draw_mode_t what) {
cmd.font(font_large)
.text(TITLE_POS, GET_TEXT_F(MSG_FILAMENT))
.font(font_medium).colors(normal_btn)
.enabled(ENABLED(FILAMENT_RUNOUT_SENSOR))
.enabled(ENABLED(HAS_FILAMENT_SENSOR))
.tag(2).button(RUNOUT_SENSOR_POS, GET_TEXT_F(MSG_RUNOUT_SENSOR))
.enabled(ENABLED(LIN_ADVANCE))
.tag(3).button(LIN_ADVANCE_POS, GET_TEXT_F(MSG_LINEAR_ADVANCE))
Expand All @@ -69,12 +69,12 @@ void FilamentMenu::onRedraw(draw_mode_t what) {

bool FilamentMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
case 2: GOTO_SCREEN(FilamentRunoutScreen); break;
case 1: GOTO_PREVIOUS(); break;
#if HAS_FILAMENT_SENSOR
case 2: GOTO_SCREEN(FilamentRunoutScreen); break;
#endif
#if ENABLED(LIN_ADVANCE)
case 3: GOTO_SCREEN(LinearAdvanceScreen); break;
case 3: GOTO_SCREEN(LinearAdvanceScreen); break;
#endif
default: return false;
}
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/extui/ftdi_eve_touch_ui/generic/screens.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ enum {
#if ENABLED(CASE_LIGHT_ENABLE)
CASE_LIGHT_SCREEN_CACHE,
#endif
#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
#if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
FILAMENT_MENU_CACHE,
#endif
#if ENABLED(LIN_ADVANCE)
LINEAR_ADVANCE_SCREEN_CACHE,
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
FILAMENT_RUNOUT_SCREEN_CACHE,
#endif
#if HAS_MEDIA
Expand Down Expand Up @@ -197,11 +197,11 @@ enum {
#include "case_light_screen.h"
#endif

#if ANY(LIN_ADVANCE, FILAMENT_RUNOUT_SENSOR)
#if ANY(LIN_ADVANCE, HAS_FILAMENT_SENSOR)
#include "filament_menu.h"
#endif

#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
#include "filament_runout_screen.h"
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ void StatusScreen::draw_interaction_buttons(draw_mode_t what) {
.button(TOOL_HEAD_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_BUTTON_PAUSE) : GET_TEXT_F(MSG_BUTTON_RESUME))
.tag(!ExtUI::isPrintingPaused() ? 7 : 14)
.button(CHANGE_FILAMENT_POS, !ExtUI::isPrintingPaused() ? GET_TEXT_F(MSG_SPEED) : F(""));
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR));
#endif
#if HAS_FILAMENT_SENSOR
cmd.tag(8).button(PREHEAT_POS, GET_TEXT_F(MSG_SENSOR));
#endif
if (ExtUI::isPrintingPaused())
draw_text_box(cmd, CHANGE_FILAMENT_POS, F("Change\nFilament"), OPT_CENTER, font_medium);
}
Expand Down Expand Up @@ -536,7 +536,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
}
break;
case 7: GOTO_SCREEN(FeedratePercentScreen); break;
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
case 8: GOTO_SCREEN(FilamentRunoutScreen); break;
#endif
case 9: injectCommands(F("G28")); break;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void onUserConfirmRequired(const char *const msg) {
case PAUSE_MESSAGE_PURGE: {
rts.sendData(ExchangePageBase + 78, ExchangepageAddr);
char newMsg[40] = "Yes to ";
strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, PSTR(" No to Purge"));
onStatusChanged(newMsg);
break;
Expand All @@ -181,7 +181,7 @@ void onUserConfirmRequired(const char *const msg) {
case PAUSE_MESSAGE_OPTION: {
rts.sendData(ExchangePageBase + 78, ExchangepageAddr);
char newMsg[40] = "Yes to ";
strcat_P(newMsg, TERN1(FILAMENT_RUNOUT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, TERN1(HAS_FILAMENT_SENSOR, !ExtUI::getFilamentRunoutState() && getFilamentRunoutEnabled()) ? PSTR("Continue") : PSTR("Disable "));
strcat_P(newMsg, PSTR(" No to Purge"));
onStatusChanged(newMsg);
break;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ia_creality/ia_creality_rts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ void RTS::handleData() {
// pause_resume_selected = true;
}
else {
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
bool runouton = false;
if (getFilamentRunoutState()) {
#if NUM_RUNOUT_SENSORS > 1
Expand Down
9 changes: 6 additions & 3 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@ void menu_backlash();

#if HAS_FILAMENT_RUNOUT_DISTANCE
editable.decimal = runout.runout_distance();
EDIT_ITEM_FAST(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, 999,
[]{ runout.set_runout_distance(editable.decimal); }, true
);
auto set_runout_distance = []{ runout.set_runout_distance(editable.decimal); };
#if ENABLED(FILAMENT_MOTION_SENSOR)
EDIT_ITEM_FAST(float31, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 0.1, 10, set_runout_distance, true);
#else
EDIT_ITEM_FAST(float3, MSG_RUNOUT_DISTANCE_MM, &editable.decimal, 1, 999, set_runout_distance, true);
#endif
#endif

END_MENU();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void menu_advanced_settings();
#if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING
__STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE);
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#if HAS_FILAMENT_SENSOR
REPEAT_1(NUM_RUNOUT_SENSORS, FIL_ITEM)
#endif

Expand Down
Loading

0 comments on commit dedbee0

Please sign in to comment.