瀏覽代碼

Fix Fan Multiplexer init

Scott Lahteine 7 年之前
父節點
當前提交
79772219ae

+ 4
- 0
Marlin/src/Marlin.cpp 查看文件

138
   #include "feature/caselight.h"
138
   #include "feature/caselight.h"
139
 #endif
139
 #endif
140
 
140
 
141
+#if HAS_FANMUX
142
+  #include "feature/fanmux.h"
143
+#endif
144
+
141
 #if (ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
145
 #if (ENABLED(SWITCHING_EXTRUDER) && !DONT_SWITCH) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
142
   #include "module/tool_change.h"
146
   #include "module/tool_change.h"
143
 #endif
147
 #endif

+ 55
- 0
Marlin/src/feature/fanmux.cpp 查看文件

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * feature/pause.cpp - Pause feature support functions
25
+ * This may be combined with related G-codes if features are consolidated.
26
+ */
27
+
28
+#include "../inc/MarlinConfig.h"
29
+
30
+#if HAS_FANMUX
31
+
32
+#include "fanmux.h"
33
+
34
+void fanmux_switch(const uint8_t e) {
35
+  WRITE(FANMUX0_PIN, TEST(e, 0) ? HIGH : LOW);
36
+  #if PIN_EXISTS(FANMUX1)
37
+    WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW);
38
+    #if PIN_EXISTS(FANMUX2)
39
+      WRITE(FANMUX2, TEST(e, 2) ? HIGH : LOW);
40
+    #endif
41
+  #endif
42
+}
43
+
44
+void fanmux_init(void) {
45
+  SET_OUTPUT(FANMUX0_PIN);
46
+  #if PIN_EXISTS(FANMUX1)
47
+    SET_OUTPUT(FANMUX1_PIN);
48
+    #if PIN_EXISTS(FANMUX2)
49
+      SET_OUTPUT(FANMUX2_PIN);
50
+    #endif
51
+  #endif
52
+  fanmux_switch(0);
53
+}
54
+
55
+#endif // HAS_FANMUX

+ 33
- 0
Marlin/src/feature/fanmux.h 查看文件

1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4
+ *
5
+ * Based on Sprinter and grbl.
6
+ * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
+ *
21
+ */
22
+
23
+/**
24
+ * feature/fanmux.h - Cooling Fan Multiplexer support functions
25
+ */
26
+
27
+#ifndef _FANMUX_H_
28
+#define _FANMUX_H_
29
+
30
+extern void fanmux_switch(const uint8_t e);
31
+extern void fanmux_init(void);
32
+
33
+#endif // _FANMUX_H_

+ 4
- 1
Marlin/src/gcode/calibrate/G33.cpp 查看文件

30
 #include "../../module/motion.h"
30
 #include "../../module/motion.h"
31
 #include "../../module/stepper.h"
31
 #include "../../module/stepper.h"
32
 #include "../../module/endstops.h"
32
 #include "../../module/endstops.h"
33
-#include "../../module/tool_change.h"
34
 #include "../../lcd/ultralcd.h"
33
 #include "../../lcd/ultralcd.h"
35
 
34
 
35
+#if HOTENDS > 1
36
+  #include "../../module/tool_change.h"
37
+#endif
38
+
36
 #if HAS_LEVELING
39
 #if HAS_LEVELING
37
   #include "../../feature/bedlevel/bedlevel.h"
40
   #include "../../feature/bedlevel/bedlevel.h"
38
 #endif
41
 #endif

+ 0
- 4
Marlin/src/module/motion.cpp 查看文件

39
   #include "../lcd/ultralcd.h"
39
   #include "../lcd/ultralcd.h"
40
 #endif
40
 #endif
41
 
41
 
42
-// #if ENABLED(DUAL_X_CARRIAGE)
43
-//   #include "tool_change.h"
44
-// #endif
45
-
46
 #if HAS_BED_PROBE
42
 #if HAS_BED_PROBE
47
   #include "probe.h"
43
   #include "probe.h"
48
 #endif
44
 #endif

+ 4
- 24
Marlin/src/module/tool_change.cpp 查看文件

50
   #include "../feature/bedlevel/bedlevel.h"
50
   #include "../feature/bedlevel/bedlevel.h"
51
 #endif
51
 #endif
52
 
52
 
53
+#if HAS_FANMUX
54
+  #include "../feature/fanmux.h"
55
+#endif
56
+
53
 #if ENABLED(SWITCHING_EXTRUDER)
57
 #if ENABLED(SWITCHING_EXTRUDER)
54
 
58
 
55
   #if EXTRUDERS > 3
59
   #if EXTRUDERS > 3
109
 
113
 
110
 #endif // PARKING_EXTRUDER
114
 #endif // PARKING_EXTRUDER
111
 
115
 
112
-#if HAS_FANMUX
113
-
114
-  void fanmux_switch(const uint8_t e) {
115
-    WRITE(FANMUX0_PIN, TEST(e, 0) ? HIGH : LOW);
116
-    #if PIN_EXISTS(FANMUX1)
117
-      WRITE(FANMUX1_PIN, TEST(e, 1) ? HIGH : LOW);
118
-      #if PIN_EXISTS(FANMUX2)
119
-        WRITE(FANMUX2, TEST(e, 2) ? HIGH : LOW);
120
-      #endif
121
-    #endif
122
-  }
123
-
124
-  FORCE_INLINE void fanmux_init(void){
125
-    SET_OUTPUT(FANMUX0_PIN);
126
-    #if PIN_EXISTS(FANMUX1)
127
-      SET_OUTPUT(FANMUX1_PIN);
128
-      #if PIN_EXISTS(FANMUX2)
129
-        SET_OUTPUT(FANMUX2_PIN);
130
-      #endif
131
-    #endif
132
-    fanmux_switch(0);
133
-  }
134
-
135
-#endif // HAS_FANMUX
136
 
116
 
137
 inline void invalid_extruder_error(const uint8_t e) {
117
 inline void invalid_extruder_error(const uint8_t e) {
138
   SERIAL_ECHO_START();
118
   SERIAL_ECHO_START();

Loading…
取消
儲存