소스 검색

Fix Fan Multiplexer init

Scott Lahteine 7 년 전
부모
커밋
79772219ae
6개의 변경된 파일100개의 추가작업 그리고 29개의 파일을 삭제
  1. 4
    0
      Marlin/src/Marlin.cpp
  2. 55
    0
      Marlin/src/feature/fanmux.cpp
  3. 33
    0
      Marlin/src/feature/fanmux.h
  4. 4
    1
      Marlin/src/gcode/calibrate/G33.cpp
  5. 0
    4
      Marlin/src/module/motion.cpp
  6. 4
    24
      Marlin/src/module/tool_change.cpp

+ 4
- 0
Marlin/src/Marlin.cpp 파일 보기

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

+ 55
- 0
Marlin/src/feature/fanmux.cpp 파일 보기

@@ -0,0 +1,55 @@
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 파일 보기

@@ -0,0 +1,33 @@
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,9 +30,12 @@
30 30
 #include "../../module/motion.h"
31 31
 #include "../../module/stepper.h"
32 32
 #include "../../module/endstops.h"
33
-#include "../../module/tool_change.h"
34 33
 #include "../../lcd/ultralcd.h"
35 34
 
35
+#if HOTENDS > 1
36
+  #include "../../module/tool_change.h"
37
+#endif
38
+
36 39
 #if HAS_LEVELING
37 40
   #include "../../feature/bedlevel/bedlevel.h"
38 41
 #endif

+ 0
- 4
Marlin/src/module/motion.cpp 파일 보기

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

+ 4
- 24
Marlin/src/module/tool_change.cpp 파일 보기

@@ -50,6 +50,10 @@
50 50
   #include "../feature/bedlevel/bedlevel.h"
51 51
 #endif
52 52
 
53
+#if HAS_FANMUX
54
+  #include "../feature/fanmux.h"
55
+#endif
56
+
53 57
 #if ENABLED(SWITCHING_EXTRUDER)
54 58
 
55 59
   #if EXTRUDERS > 3
@@ -109,30 +113,6 @@
109 113
 
110 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 117
 inline void invalid_extruder_error(const uint8_t e) {
138 118
   SERIAL_ECHO_START();

Loading…
취소
저장