Skip to content

Commit 12e2316

Browse files
authored
Merge branch 'knutwurst:master' into klicky
2 parents 78eab4e + 570c419 commit 12e2316

File tree

11 files changed

+374
-792
lines changed

11 files changed

+374
-792
lines changed

Marlin/Configuration.h

+5-8
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
*/
3838
#define CONFIGURATION_H_VERSION 02010200
3939
#define ANYCUBIC_TOUCHSCREEN
40-
#if DISABLED(KNUTWURST_4MAXP2)
41-
#define ANYCUBIC_FILAMENT_RUNOUT_SENSOR
42-
#endif
4340
#define KNUTWURST_SPECIAL_MENU
4441
#define KNUTWURST_SPECIAL_MENU_WO_SD
4542
// #define ANYCUBIC_TFT_DEBUG
@@ -2389,15 +2386,15 @@
23892386
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
23902387
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
23912388
*/
2392-
// #define FILAMENT_RUNOUT_SENSOR
2389+
#define FILAMENT_RUNOUT_SENSOR
23932390
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
23942391
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
23952392
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
23962393

2397-
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
2398-
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
2399-
// #define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
2400-
// #define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
2394+
#define FIL_RUNOUT_STATE HIGH // Pin state indicating that filament is NOT present.
2395+
// #define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
2396+
// #define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
2397+
// #define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
24012398
// This is automatically enabled for MIXING_EXTRUDERs.
24022399

24032400
// Override individually if the runout sensors vary

Marlin/Configuration_adv.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@
15511551

15521552
// #define MEDIA_MENU_AT_TOP // Force the media menu to be listed on the top of the main menu
15531553

1554-
#define EVENT_GCODE_SD_ABORT "G28XY" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
1554+
#define EVENT_GCODE_SD_ABORT "G27" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")
15551555

15561556
#if ENABLED(PRINTER_EVENT_LEDS)
15571557
#define PE_LEDS_COMPLETED_TIME (30 * 60) // (seconds) Time to keep the LED "done" color before restoring normal illumination
@@ -2658,7 +2658,7 @@
26582658
*/
26592659
#define ADVANCED_PAUSE_FEATURE
26602660
#if ENABLED(ADVANCED_PAUSE_FEATURE)
2661-
#define PAUSE_PARK_RETRACT_FEEDRATE 60 // (mm/s) Initial retract feedrate.
2661+
#define PAUSE_PARK_RETRACT_FEEDRATE 40 // (mm/s) Initial retract feedrate.
26622662
#define PAUSE_PARK_RETRACT_LENGTH 4 // (mm) Initial retract.
26632663
// This short retract is done immediately, before parking the nozzle.
26642664
#define FILAMENT_CHANGE_UNLOAD_FEEDRATE 30 // (mm/s) Unload filament feedrate. This can be pretty fast.
@@ -2675,7 +2675,7 @@
26752675
#define FILAMENT_CHANGE_FAST_LOAD_LENGTH 538 // (mm) Load length of filament, from extruder gear to nozzle.
26762676
// For Bowden, the full length of the tube and nozzle.
26772677
// For direct drive, the full length of the nozzle.
2678-
// #define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
2678+
#define ADVANCED_PAUSE_CONTINUOUS_PURGE // Purge continuously up to the purge length until interrupted.
26792679
#define ADVANCED_PAUSE_PURGE_FEEDRATE 2 // (mm/s) Extrude feedrate (after loading). Should be slower than load feedrate.
26802680
#define ADVANCED_PAUSE_PURGE_LENGTH 2 // (mm) Length to extrude after loading.
26812681
// Set to 0 for manual extrusion.
@@ -2690,7 +2690,7 @@
26902690
#define FILAMENT_UNLOAD_PURGE_LENGTH 8 // (mm) An unretract is done, then this length is purged.
26912691
#define FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
26922692

2693-
#define PAUSE_PARK_NOZZLE_TIMEOUT 60 // (seconds) Time limit before the nozzle is turned off for safety.
2693+
#define PAUSE_PARK_NOZZLE_TIMEOUT 300 // (seconds) Time limit before the nozzle is turned off for safety.
26942694
#define FILAMENT_CHANGE_ALERT_BEEPS 10 // Number of alert beeps to play when a response is needed.
26952695
#define PAUSE_PARK_NO_STEPPER_TIMEOUT // Enable for XYZ steppers to stay powered on during filament change.
26962696
// #define FILAMENT_CHANGE_RESUME_ON_INSERT // Automatically continue / load filament when runout sensor is triggered again.
@@ -4012,7 +4012,7 @@
40124012
#define HOST_PAUSE_M76 // Tell the host to pause in response to M76
40134013
#define HOST_PROMPT_SUPPORT // Initiate host prompts to get user feedback
40144014
#if ENABLED(HOST_PROMPT_SUPPORT)
4015-
// #define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications
4015+
#define HOST_STATUS_NOTIFICATIONS // Send some status messages to the host as notifications
40164016
#endif
40174017
// #define HOST_START_MENU_ITEM // Add a menu item that tells the host to start
40184018
// #define HOST_SHUTDOWN_MENU_ITEM // Add a menu item that tells the host to shut down

Marlin/src/MarlinCore.cpp

-100
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,6 @@
252252
#include "tests/marlin_tests.h"
253253
#endif
254254

255-
// PATCH START: Knutwurst
256-
#if ENABLED(ANYCUBIC_TOUCHSCREEN)
257-
#include "lcd/extui/knutwurst/anycubic_touchscreen.h"
258-
#endif
259-
// PATCH END: Knutwurst
260-
261255
PGMSTR(M112_KILL_STR, "M112 Shutdown");
262256

263257
MarlinState marlin_state = MF_INITIALIZING;
@@ -396,88 +390,6 @@ void startOrResumeJob() {
396390

397391
#endif // SDSUPPORT
398392

399-
// PATCH START: Knutwurst
400-
#ifdef ENDSTOP_BEEP
401-
void EndstopBeep() {
402-
static char last_status = ((READ(X_MIN_PIN) << 2) | (READ(Y_MIN_PIN) << 1) | READ(X_MAX_PIN));
403-
static unsigned char now_status;
404-
405-
now_status = ((READ(X_MIN_PIN) << 2) | (READ(Y_MIN_PIN) << 1) | READ(X_MAX_PIN)) & 0xff;
406-
407-
if (now_status<last_status) {
408-
static millis_t endstop_ms = millis() + 300UL;
409-
if (ELAPSED(millis(), endstop_ms)) {
410-
buzzer.tone(60, 2000);
411-
}
412-
last_status = now_status;
413-
} else if (now_status != last_status) {
414-
last_status=now_status;
415-
}
416-
}
417-
#endif
418-
419-
#if HAS_FILAMENT_SENSOR
420-
void event_filament_runout() {
421-
#if ENABLED(ADVANCED_PAUSE_FEATURE)
422-
if (did_pause_print) return; // Action already in progress. Purge triggered repeated runout.
423-
#endif
424-
425-
#if ENABLED(EXTENSIBLE_UI)
426-
ExtUI::onFilamentRunout(ExtUI::getActiveTool());
427-
#endif
428-
429-
#if EITHER(HOST_PROMPT_SUPPORT, HOST_ACTION_COMMANDS)
430-
const char tool = '0'
431-
#if NUM_RUNOUT_SENSORS > 1
432-
+ active_extruder
433-
#endif
434-
;
435-
#endif
436-
437-
//action:out_of_filament
438-
#if ENABLED(HOST_PROMPT_SUPPORT)
439-
host_prompt_reason = PROMPT_FILAMENT_RUNOUT;
440-
host_action_prompt_end();
441-
host_action_prompt_begin(PSTR("FilamentRunout T"), false);
442-
SERIAL_CHAR(tool);
443-
SERIAL_EOL();
444-
host_action_prompt_show();
445-
#endif
446-
447-
const bool run_runout_script = !runout.host_handling;
448-
449-
#if ENABLED(HOST_ACTION_COMMANDS)
450-
if (run_runout_script
451-
&& ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
452-
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
453-
#if ENABLED(ADVANCED_PAUSE_FEATURE)
454-
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M25")
455-
#endif
456-
)
457-
) {
458-
host_action_paused(false);
459-
} else {
460-
// Legacy Repetier command for use until newer version supports standard dialog
461-
// To be removed later when pause command also triggers dialog
462-
#ifdef ACTION_ON_FILAMENT_RUNOUT
463-
host_action(PSTR(ACTION_ON_FILAMENT_RUNOUT " T"), false);
464-
SERIAL_CHAR(tool);
465-
SERIAL_EOL();
466-
#endif
467-
468-
host_action_pause(false);
469-
}
470-
SERIAL_ECHOPGM(" " ACTION_REASON_ON_FILAMENT_RUNOUT " ");
471-
SERIAL_CHAR(tool);
472-
SERIAL_EOL();
473-
#endif // HOST_ACTION_COMMANDS
474-
475-
if (run_runout_script) {
476-
queue.inject_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
477-
}
478-
}
479-
#endif // HAS_FILAMENT_SENSOR
480-
// PATCH END: Knutwurst
481393

482394
/**
483395
* Minimal management of Marlin's core activities:
@@ -493,12 +405,6 @@ void EndstopBeep() {
493405
* - Pulse FET_SAFETY_PIN if it exists
494406
*/
495407
inline void manage_inactivity(const bool no_stepper_sleep=false) {
496-
// PATCH START: Knutwurst
497-
#if ENABLED(ANYCUBIC_TOUCHSCREEN) && ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR)
498-
AnycubicTouchscreen.FilamentRunout();
499-
#endif
500-
// PATCH END: Knutwurst
501-
502408
queue.get_available_commands();
503409

504410
const millis_t ms = millis();
@@ -889,12 +795,6 @@ void idle(bool no_stepper_sleep/*=false*/) {
889795
// Max7219 heartbeat, animation, etc
890796
TERN_(MAX7219_DEBUG, max7219.idle_tasks());
891797

892-
// PATCH START: Knutwurst
893-
#ifdef ENDSTOP_BEEP
894-
EndstopBeep();
895-
#endif
896-
// PATCH END: Knutwurst
897-
898798
// Return if setup() isn't completed
899799
if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
900800

Marlin/src/feature/pause.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -576,17 +576,7 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
576576
IF_DISABLED(PAUSE_REHEAT_FAST_RESUME, wait_for_user = true);
577577

578578
nozzle_timed_out = false;
579-
/*
580-
#ifdef ANYCUBIC_TOUCHSCREEN
581-
if (AnycubicTouchscreen.ai3m_pause_state > 3) {
582-
AnycubicTouchscreen.ai3m_pause_state -= 3;
583-
#ifdef ANYCUBIC_TFT_DEBUG
584-
SERIAL_ECHOPGM(" DEBUG: NTO - AI3M Pause State set to: ", AnycubicTouchscreen.ai3m_pause_state);
585-
SERIAL_EOL();
586-
#endif
587-
}
588-
#endif
589-
*/
579+
590580
first_impatient_beep(max_beep_count);
591581
}
592582
idle_no_sleep();

Marlin/src/gcode/feature/pause/M600.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@
3030
#include "../../../module/printcounter.h"
3131
#include "../../../lcd/marlinui.h"
3232

33-
// PATCH START: Knutwurst
34-
#ifdef ANYCUBIC_TOUCHSCREEN
35-
#include "../../../lcd/extui/knutwurst/anycubic_touchscreen.h"
36-
#include "../../../sd/cardreader.h"
37-
#endif
38-
// PATCH END: Knutwurst
39-
4033
#if HAS_MULTI_EXTRUDER
4134
#include "../../../module/tool_change.h"
4235
#endif
@@ -78,29 +71,6 @@
7871
* Default values are used for omitted arguments.
7972
*/
8073
void GcodeSuite::M600() {
81-
// PATCH START: Knutwurst
82-
#ifdef ANYCUBIC_TOUCHSCREEN
83-
#ifdef SDSUPPORT
84-
if (card.isPrinting()) { // are we printing from sd?
85-
if (AnycubicTouchscreen.ai3m_pause_state < 2) {
86-
AnycubicTouchscreen.ai3m_pause_state = 2;
87-
#ifdef ANYCUBIC_TFT_DEBUG
88-
SERIAL_ECHOPGM(" DEBUG: M600 - AI3M Pause State set to: ", AnycubicTouchscreen.ai3m_pause_state);
89-
SERIAL_EOL();
90-
#endif
91-
}
92-
#ifdef ANYCUBIC_TFT_DEBUG
93-
SERIAL_ECHOLNPGM("DEBUG: Enter M600 TFTstate routine");
94-
#endif
95-
AnycubicTouchscreen.TFTstate = ANYCUBIC_TFT_STATE_SDPAUSE_REQ; // enter correct display state to show resume button
96-
#ifdef ANYCUBIC_TFT_DEBUG
97-
SERIAL_ECHOLNPGM("DEBUG: Set TFTstate to SDPAUSE_REQ");
98-
#endif
99-
}
100-
#endif
101-
#endif
102-
// PATCH END: Knutwurst
103-
10474
#if ENABLED(MIXING_EXTRUDER)
10575
const int8_t eindex = get_target_e_stepper_from_command();
10676
if (eindex < 0) return;

Marlin/src/gcode/temp/M104_M109.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838

3939
#include "../../MarlinCore.h" // for startOrResumeJob, etc.
4040

41-
#ifdef ANYCUBIC_TOUCHSCREEN
42-
#include "../../lcd/extui/knutwurst/anycubic_touchscreen.h"
43-
#endif
44-
4541
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
4642
#include "../../module/printcounter.h"
4743
#if ENABLED(CANCEL_OBJECTS)
@@ -133,22 +129,13 @@ void GcodeSuite::M104_M109(const bool isM109) {
133129
thermalManager.set_heating_message(target_extruder, !isM109 && got_temp);
134130
}
135131

136-
#ifdef ANYCUBIC_TOUCHSCREEN
137-
AnycubicTouchscreen.HeatingStart();
138-
#endif
139-
140132
TERN_(AUTOTEMP, planner.autotemp_M104_M109());
141133

142134
if (isM109 && got_temp)
143135
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);
144136

145137
// flush the serial buffer after heating to prevent lockup by m105
146138
SERIAL_FLUSH();
147-
148-
#ifdef ANYCUBIC_TOUCHSCREEN
149-
AnycubicTouchscreen.CommandScan();
150-
AnycubicTouchscreen.BedHeatingDone();
151-
#endif
152139
}
153140

154141
#endif // EXTRUDERS

Marlin/src/inc/Version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
* here we define this default string as the date where the latest release
4242
* version was tagged.
4343
*/
44-
#define CUSTOM_BUILD_VERSION "1.5.0-b3"
44+
#define CUSTOM_BUILD_VERSION "1.5.0-b5"
4545

4646
#ifndef STRING_DISTRIBUTION_DATE
47-
#define STRING_DISTRIBUTION_DATE "2023-01-03"
47+
#define STRING_DISTRIBUTION_DATE "2023-05-24"
4848
#endif
4949

5050
/**

0 commit comments

Comments
 (0)