Преглед изворни кода

SAMD51: ADC for probe temperature compensation (#16596)

Giuliano Zaro пре 4 година
родитељ
комит
aec211fc80
1 измењених фајлова са 18 додато и 0 уклоњено
  1. 18
    0
      Marlin/src/HAL/HAL_SAMD51/HAL.cpp

+ 18
- 0
Marlin/src/HAL/HAL_SAMD51/HAL.cpp Прегледај датотеку

59
 #else
59
 #else
60
   #define GET_TEMP_5_ADC()          -1
60
   #define GET_TEMP_5_ADC()          -1
61
 #endif
61
 #endif
62
+#if HAS_TEMP_PROBE
63
+  #define GET_PROBE_ADC()           PIN_TO_ADC(TEMP_PROBE_PIN)
64
+#else
65
+  #define GET_PROBE_ADC()           -1
66
+#endif
62
 #if HAS_TEMP_ADC_BED
67
 #if HAS_TEMP_ADC_BED
63
   #define GET_BED_ADC()             PIN_TO_ADC(TEMP_BED_PIN)
68
   #define GET_BED_ADC()             PIN_TO_ADC(TEMP_BED_PIN)
64
 #else
69
 #else
82
 
87
 
83
 #define IS_ADC_REQUIRED(n)      (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n      \
88
 #define IS_ADC_REQUIRED(n)      (GET_TEMP_0_ADC() == n || GET_TEMP_1_ADC() == n || GET_TEMP_2_ADC() == n      \
84
                                  || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n   \
89
                                  || GET_TEMP_3_ADC() == n || GET_TEMP_4_ADC() == n || GET_TEMP_5_ADC() == n   \
90
+                                 || GET_PROBE_ADC() == n                                                      \
85
                                  || GET_BED_ADC() == n                                                        \
91
                                  || GET_BED_ADC() == n                                                        \
86
                                  || GET_CHAMBER_ADC() == n                                                    \
92
                                  || GET_CHAMBER_ADC() == n                                                    \
87
                                  || GET_FILAMENT_WIDTH_ADC() == n                                             \
93
                                  || GET_FILAMENT_WIDTH_ADC() == n                                             \
145
     #if GET_TEMP_5_ADC() == 0
151
     #if GET_TEMP_5_ADC() == 0
146
       TEMP_5_PIN,
152
       TEMP_5_PIN,
147
     #endif
153
     #endif
154
+    #if GET_PROBE_ADC() == 0
155
+      TEMP_PROBE_PIN,
156
+    #endif
148
     #if GET_BED_ADC() == 0
157
     #if GET_BED_ADC() == 0
149
       TEMP_BED_PIN,
158
       TEMP_BED_PIN,
150
     #endif
159
     #endif
176
     #if GET_TEMP_5_ADC() == 1
185
     #if GET_TEMP_5_ADC() == 1
177
       TEMP_5_PIN,
186
       TEMP_5_PIN,
178
     #endif
187
     #endif
188
+    #if GET_PROBE_ADC() == 1
189
+      TEMP_PROBE_PIN,
190
+    #endif
179
     #if GET_BED_ADC() == 1
191
     #if GET_BED_ADC() == 1
180
       TEMP_BED_PIN,
192
       TEMP_BED_PIN,
181
     #endif
193
     #endif
215
       #if GET_TEMP_5_ADC() == 0
227
       #if GET_TEMP_5_ADC() == 0
216
         { PIN_TO_INPUTCTRL(TEMP_5_PIN) },
228
         { PIN_TO_INPUTCTRL(TEMP_5_PIN) },
217
       #endif
229
       #endif
230
+      #if GET_PROBE_ADC() == 0
231
+        { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
232
+      #endif
218
       #if GET_BED_ADC() == 0
233
       #if GET_BED_ADC() == 0
219
         { PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
234
         { PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
220
       #endif
235
       #endif
255
       #if GET_TEMP_5_ADC() == 1
270
       #if GET_TEMP_5_ADC() == 1
256
         { PIN_TO_INPUTCTRL(TEMP_5_PIN) },
271
         { PIN_TO_INPUTCTRL(TEMP_5_PIN) },
257
       #endif
272
       #endif
273
+      #if GET_PROBE_ADC() == 1
274
+        { PIN_TO_INPUTCTRL(TEMP_PROBE_PIN) },
275
+      #endif
258
       #if GET_BED_ADC() == 1
276
       #if GET_BED_ADC() == 1
259
         { PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
277
         { PIN_TO_INPUTCTRL(TEMP_BED_PIN) },
260
       #endif
278
       #endif

Loading…
Откажи
Сачувај