浏览代码

Increase MMU2 serial buffer size with USB serial (#15646)

Timm 5 年前
父节点
当前提交
e02b06672c
共有 2 个文件被更改,包括 10 次插入2 次删除
  1. 1
    1
      Marlin/src/feature/prusa_MMU2/mmu2.cpp
  2. 9
    1
      Marlin/src/feature/prusa_MMU2/mmu2.h

+ 1
- 1
Marlin/src/feature/prusa_MMU2/mmu2.cpp 查看文件

@@ -97,7 +97,7 @@ volatile int8_t MMU2::finda = 1;
97 97
 volatile bool MMU2::finda_runout_valid;
98 98
 int16_t MMU2::version = -1, MMU2::buildnr = -1;
99 99
 millis_t MMU2::last_request, MMU2::next_P0_request;
100
-char MMU2::rx_buffer[16], MMU2::tx_buffer[16];
100
+char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE];
101 101
 
102 102
 #if HAS_LCD_MENU && ENABLED(MMU2_MENUS)
103 103
 

+ 9
- 1
Marlin/src/feature/prusa_MMU2/mmu2.h 查看文件

@@ -27,6 +27,14 @@
27 27
   #include "../runout.h"
28 28
 #endif
29 29
 
30
+#if SERIAL_USB
31
+  #define MMU_RX_SIZE 256
32
+  #define MMU_TX_SIZE 256
33
+#else
34
+  #define MMU_RX_SIZE  16
35
+  #define MMU_TX_SIZE  16
36
+#endif
37
+
30 38
 struct E_Step;
31 39
 
32 40
 class MMU2 {
@@ -79,7 +87,7 @@ private:
79 87
   static volatile bool finda_runout_valid;
80 88
   static int16_t version, buildnr;
81 89
   static millis_t last_request, next_P0_request;
82
-  static char rx_buffer[16], tx_buffer[16];
90
+  static char rx_buffer[MMU_RX_SIZE], tx_buffer[MMU_TX_SIZE];
83 91
 
84 92
   static inline void set_runout_valid(const bool valid) {
85 93
     finda_runout_valid = valid;

正在加载...
取消
保存