252
252
#include " tests/marlin_tests.h"
253
253
#endif
254
254
255
- // PATCH START: Knutwurst
256
- #if ENABLED(ANYCUBIC_TOUCHSCREEN)
257
- #include " lcd/extui/knutwurst/anycubic_touchscreen.h"
258
- #endif
259
- // PATCH END: Knutwurst
260
-
261
255
PGMSTR (M112_KILL_STR, " M112 Shutdown" );
262
256
263
257
MarlinState marlin_state = MF_INITIALIZING;
@@ -396,88 +390,6 @@ void startOrResumeJob() {
396
390
397
391
#endif // SDSUPPORT
398
392
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
481
393
482
394
/* *
483
395
* Minimal management of Marlin's core activities:
@@ -493,12 +405,6 @@ void EndstopBeep() {
493
405
* - Pulse FET_SAFETY_PIN if it exists
494
406
*/
495
407
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
-
502
408
queue.get_available_commands ();
503
409
504
410
const millis_t ms = millis ();
@@ -889,12 +795,6 @@ void idle(bool no_stepper_sleep/*=false*/) {
889
795
// Max7219 heartbeat, animation, etc
890
796
TERN_ (MAX7219_DEBUG, max7219.idle_tasks ());
891
797
892
- // PATCH START: Knutwurst
893
- #ifdef ENDSTOP_BEEP
894
- EndstopBeep ();
895
- #endif
896
- // PATCH END: Knutwurst
897
-
898
798
// Return if setup() isn't completed
899
799
if (marlin_state == MF_INITIALIZING) goto IDLE_DONE;
900
800
0 commit comments