Kaynağa Gözat

✨ Optional HOST_STATUS_NOTIFICATIONS (#22833)

Taylor Talkington 3 yıl önce
ebeveyn
işleme
7763f9385d
No account linked to committer's email address

+ 7
- 4
Marlin/Configuration_adv.h Dosyayı Görüntüle

@@ -3952,10 +3952,13 @@
3952 3952
  */
3953 3953
 //#define HOST_ACTION_COMMANDS
3954 3954
 #if ENABLED(HOST_ACTION_COMMANDS)
3955
-  //#define HOST_PAUSE_M76
3956
-  //#define HOST_PROMPT_SUPPORT
3957
-  //#define HOST_START_MENU_ITEM      // Add a menu item that tells the host to start
3958
-  //#define HOST_SHUTDOWN_MENU_ITEM   // Add a menu item that tells the host to shut down
3955
+  //#define HOST_PAUSE_M76                // Tell the host to pause in response to M76
3956
+  //#define HOST_PROMPT_SUPPORT           // Initiate host prompts to get user feedback
3957
+  #if ENABLED(HOST_PROMPT_SUPPORT)
3958
+    //#define HOST_STATUS_NOTIFICATIONS   // Send some status messages to the host as notifications
3959
+  #endif
3960
+  //#define HOST_START_MENU_ITEM          // Add a menu item that tells the host to start
3961
+  //#define HOST_SHUTDOWN_MENU_ITEM       // Add a menu item that tells the host to shut down
3959 3962
 #endif
3960 3963
 
3961 3964
 /**

+ 8
- 0
Marlin/src/gcode/control/M111.cpp Dosyayı Görüntüle

@@ -22,12 +22,20 @@
22 22
 
23 23
 #include "../gcode.h"
24 24
 
25
+#if ENABLED(HOST_ACTION_COMMANDS)
26
+  #include "../../feature/host_actions.h"
27
+#endif
28
+
25 29
 /**
26 30
  * M111: Set the debug level
27 31
  */
28 32
 void GcodeSuite::M111() {
29 33
   if (parser.seenval('S')) marlin_debug_flags = parser.value_byte();
30 34
 
35
+  #if EITHER(HOST_ACTION_COMMANDS, HOST_PROMPT_SUPPORT)
36
+    if (parser.seenval('H')) hostui.flag.bits = parser.value_byte();
37
+  #endif
38
+
31 39
   static PGMSTR(str_debug_1, STR_DEBUG_ECHO);
32 40
   static PGMSTR(str_debug_2, STR_DEBUG_INFO);
33 41
   static PGMSTR(str_debug_4, STR_DEBUG_ERRORS);

+ 0
- 6
Marlin/src/inc/SanityCheck.h Dosyayı Görüntüle

@@ -611,12 +611,6 @@
611 611
   #error "DEFAULT_LCD_BRIGHTNESS is now LCD_BRIGHTNESS_DEFAULT."
612 612
 #endif
613 613
 
614
-#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
615
-  #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
616
-#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
617
-  #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
618
-#endif
619
-
620 614
 constexpr float arm[] = AXIS_RELATIVE_MODES;
621 615
 static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _LOGICAL_AXES_STR "elements.");
622 616
 

+ 10
- 0
Marlin/src/inc/Warnings.cpp Dosyayı Görüntüle

@@ -59,6 +59,12 @@
59 59
   #warning "Your Configuration provides no method to acquire user feedback!"
60 60
 #endif
61 61
 
62
+#if MB(DUE3DOM_MINI) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
63
+  #warning "Onboard temperature sensor for BOARD_DUE3DOM_MINI has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
64
+#elif MB(BTT_SKR_E3_TURBO) && PIN_EXISTS(TEMP_2) && DISABLED(TEMP_SENSOR_BOARD)
65
+  #warning "Onboard temperature sensor for BOARD_BTT_SKR_E3_TURBO has moved from TEMP_SENSOR_2 (TEMP_2_PIN) to TEMP_SENSOR_BOARD (TEMP_BOARD_PIN)."
66
+#endif
67
+
62 68
 #ifndef NO_AUTO_ASSIGN_WARNING
63 69
 
64 70
   #if AUTO_ASSIGNED_X2_STEPPER
@@ -541,6 +547,10 @@
541 547
   #warning "Creality 4.2.2 boards come with a variety of stepper drivers. Check the board label and set the correct *_DRIVER_TYPE! (C=HR4988, E=A4988, A=TMC2208, B=TMC2209, H=TMC2225)."
542 548
 #endif
543 549
 
550
+#if PRINTCOUNTER_SYNC
551
+  #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
552
+#endif
553
+
544 554
 #if HOMING_Z_WITH_PROBE && IS_CARTESIAN && DISABLED(Z_SAFE_HOMING)
545 555
   #error "Z_SAFE_HOMING is recommended when homing with a probe. Enable Z_SAFE_HOMING or comment out this line to continue."
546 556
 #endif

+ 5
- 2
Marlin/src/lcd/marlinui.cpp Dosyayı Görüntüle

@@ -1363,7 +1363,7 @@ void MarlinUI::init() {
1363 1363
   void MarlinUI::set_status(const char * const cstr, const bool persist) {
1364 1364
     if (alert_level) return;
1365 1365
 
1366
-    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(cstr));
1366
+    TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(cstr));
1367 1367
 
1368 1368
     // Here we have a problem. The message is encoded in UTF8, so
1369 1369
     // arbitrarily cutting it will be a problem. We MUST be sure
@@ -1435,7 +1435,7 @@ void MarlinUI::init() {
1435 1435
     if (level < alert_level) return;
1436 1436
     alert_level = level;
1437 1437
 
1438
-    TERN_(HOST_PROMPT_SUPPORT, hostui.notify(fstr));
1438
+    TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(fstr));
1439 1439
 
1440 1440
     // Since the message is encoded in UTF8 it must
1441 1441
     // only be cut on a character boundary.
@@ -1473,6 +1473,9 @@ void MarlinUI::init() {
1473 1473
     va_start(args, FTOP(fmt));
1474 1474
     vsnprintf_P(status_message, MAX_MESSAGE_LENGTH, FTOP(fmt), args);
1475 1475
     va_end(args);
1476
+
1477
+    TERN_(HOST_STATUS_NOTIFICATIONS, hostui.notify(status_message));
1478
+
1476 1479
     finish_status(level > 0);
1477 1480
   }
1478 1481
 

+ 0
- 1
Marlin/src/module/printcounter.cpp Dosyayı Görüntüle

@@ -43,7 +43,6 @@ Stopwatch print_job_timer;      // Global Print Job Timer instance
43 43
 
44 44
 #if PRINTCOUNTER_SYNC
45 45
   #include "../module/planner.h"
46
-  #warning "To prevent step loss, motion will pause for PRINTCOUNTER auto-save."
47 46
 #endif
48 47
 
49 48
 // Service intervals

+ 20
- 3
Marlin/src/module/settings.cpp Dosyayı Görüntüle

@@ -80,6 +80,10 @@
80 80
   #include "../lcd/e3v2/jyersui/dwin.h"
81 81
 #endif
82 82
 
83
+#if ENABLED(HOST_PROMPT_SUPPORT)
84
+  #include "../feature/host_actions.h"
85
+#endif
86
+
83 87
 #if HAS_SERVOS
84 88
   #include "servo.h"
85 89
 #endif
@@ -652,6 +656,10 @@ void MarlinSettings::postprocess() {
652 656
 #define DEBUG_OUT EITHER(EEPROM_CHITCHAT, DEBUG_LEVELING_FEATURE)
653 657
 #include "../core/debug_out.h"
654 658
 
659
+#if BOTH(EEPROM_CHITCHAT, HOST_PROMPT_SUPPORT)
660
+  #define HOST_EEPROM_CHITCHAT 1
661
+#endif
662
+
655 663
 #if ENABLED(EEPROM_SETTINGS)
656 664
 
657 665
   #define EEPROM_ASSERT(TST,ERR)  do{ if (!(TST)) { SERIAL_ERROR_MSG(ERR); eeprom_error = true; } }while(0)
@@ -1554,7 +1562,10 @@ void MarlinSettings::postprocess() {
1554 1562
         store_mesh(ubl.storage_slot);
1555 1563
     #endif
1556 1564
 
1557
-    if (!eeprom_error) LCD_MESSAGE(MSG_SETTINGS_STORED);
1565
+    if (!eeprom_error) {
1566
+      LCD_MESSAGE(MSG_SETTINGS_STORED);
1567
+      TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_SETTINGS_STORED)));
1568
+    }
1558 1569
 
1559 1570
     TERN_(EXTENSIBLE_UI, ExtUI::onConfigurationStoreWritten(!eeprom_error));
1560 1571
 
@@ -1578,6 +1589,7 @@ void MarlinSettings::postprocess() {
1578 1589
       }
1579 1590
       DEBUG_ECHO_MSG("EEPROM version mismatch (EEPROM=", stored_ver, " Marlin=" EEPROM_VERSION ")");
1580 1591
       TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_VERSION));
1592
+      TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_VERSION)));
1581 1593
 
1582 1594
       IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_version());
1583 1595
       eeprom_error = true;
@@ -2468,12 +2480,14 @@ void MarlinSettings::postprocess() {
2468 2480
         eeprom_error = true;
2469 2481
         DEBUG_ERROR_MSG("EEPROM CRC mismatch - (stored) ", stored_crc, " != ", working_crc, " (calculated)!");
2470 2482
         TERN_(DWIN_CREALITY_LCD_ENHANCED, LCD_MESSAGE(MSG_ERR_EEPROM_CRC));
2483
+        TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(GET_TEXT_F(MSG_ERR_EEPROM_CRC)));
2471 2484
         IF_DISABLED(EEPROM_AUTO_INIT, ui.eeprom_alert_crc());
2472 2485
       }
2473 2486
       else if (!validating) {
2474 2487
         DEBUG_ECHO_START();
2475 2488
         DEBUG_ECHO(version);
2476 2489
         DEBUG_ECHOLNPGM(" stored settings retrieved (", eeprom_index - (EEPROM_OFFSET), " bytes; crc ", (uint32_t)working_crc, ")");
2490
+        TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(F("Stored settings retrieved")));
2477 2491
       }
2478 2492
 
2479 2493
       if (!validating && !eeprom_error) postprocess();
@@ -2783,7 +2797,6 @@ void MarlinSettings::reset() {
2783 2797
     #endif
2784 2798
   #endif
2785 2799
 
2786
-  TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
2787 2800
   TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_SetDataDefaults());
2788 2801
   TERN_(DWIN_CREALITY_LCD_JYERSUI, CrealityDWIN.Reset_Settings());
2789 2802
 
@@ -3142,7 +3155,11 @@ void MarlinSettings::reset() {
3142 3155
 
3143 3156
   postprocess();
3144 3157
 
3145
-  DEBUG_ECHO_MSG("Hardcoded Default Settings Loaded");
3158
+  FSTR_P const hdsl = F("Hardcoded Default Settings Loaded");
3159
+  TERN_(HOST_EEPROM_CHITCHAT, hostui.notify(hdsl));
3160
+  DEBUG_ECHO_START(); DEBUG_ECHOLNF(hdsl);
3161
+
3162
+  TERN_(EXTENSIBLE_UI, ExtUI::onFactoryReset());
3146 3163
 }
3147 3164
 
3148 3165
 #if DISABLED(DISABLE_M503)

+ 4
- 0
Marlin/src/module/temperature.cpp Dosyayı Görüntüle

@@ -629,6 +629,7 @@ volatile bool Temperature::raw_temps_ready = false;
629 629
       SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
630 630
       TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
631 631
       TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
632
+      TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)));
632 633
       return;
633 634
     }
634 635
 
@@ -719,6 +720,7 @@ volatile bool Temperature::raw_temps_ready = false;
719 720
         SERIAL_ECHOLNPGM(STR_PID_TEMP_TOO_HIGH);
720 721
         TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TEMP_TOO_HIGH));
721 722
         TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TEMP_TOO_HIGH));
723
+        TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH)));
722 724
         break;
723 725
       }
724 726
 
@@ -756,12 +758,14 @@ volatile bool Temperature::raw_temps_ready = false;
756 758
         TERN_(DWIN_CREALITY_LCD, DWIN_Popup_Temperature(0));
757 759
         TERN_(DWIN_CREALITY_LCD_ENHANCED, DWIN_PidTuning(PID_TUNING_TIMEOUT));
758 760
         TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_TUNING_TIMEOUT));
761
+        TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_TIMEOUT)));
759 762
         SERIAL_ECHOLNPGM(STR_PID_TIMEOUT);
760 763
         break;
761 764
       }
762 765
 
763 766
       if (cycles > ncycles && cycles > 2) {
764 767
         SERIAL_ECHOLNPGM(STR_PID_AUTOTUNE_FINISHED);
768
+        TERN_(HOST_PROMPT_SUPPORT, hostui.notify(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE)));
765 769
 
766 770
         #if EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
767 771
           FSTR_P const estring = GHV(F("chamber"), F("bed"), FPSTR(NUL_STR));

+ 1
- 1
buildroot/tests/rambo Dosyayı Görüntüle

@@ -115,7 +115,7 @@ opt_set MOTHERBOARD BOARD_RAMBO \
115 115
         FAN_MIN_PWM 50 FAN_KICKSTART_TIME 100 \
116 116
         XY_FREQUENCY_LIMIT 15
117 117
 opt_enable COREYX USE_XMAX_PLUG MIXING_EXTRUDER GRADIENT_MIX \
118
-           BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY FILAMENT_WIDTH_SENSOR \
118
+           BABYSTEPPING BABYSTEP_DISPLAY_TOTAL FILAMENT_LCD_DISPLAY \
119 119
            REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER MENU_ADDAUTOSTART SDSUPPORT SDCARD_SORT_ALPHA \
120 120
            ENDSTOP_NOISE_THRESHOLD FAN_SOFT_PWM \
121 121
            FIX_MOUNTED_PROBE PROBING_ESTEPPERS_OFF PROBE_OFFSET_WIZARD \

Loading…
İptal
Kaydet