瀏覽代碼

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

Loading…
取消
儲存