File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -209,16 +209,17 @@ int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
209
209
// ADC
210
210
// ------------------------
211
211
212
- #define ADC1_CHANNEL (pin ) ADC1_GPIO ## pin ## _CHANNEL
213
-
212
+ // https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/peripherals/adc.html
214
213
adc1_channel_t get_channel (int pin) {
215
214
switch (pin) {
216
- case 39 : return ADC1_CHANNEL (39 );
217
- case 36 : return ADC1_CHANNEL (36 );
218
- case 35 : return ADC1_CHANNEL (35 );
219
- case 34 : return ADC1_CHANNEL (34 );
220
- case 33 : return ADC1_CHANNEL (33 );
221
- case 32 : return ADC1_CHANNEL (32 );
215
+ case 39 : return ADC1_CHANNEL_3;
216
+ case 36 : return ADC1_CHANNEL_0;
217
+ case 35 : return ADC1_CHANNEL_7;
218
+ case 34 : return ADC1_CHANNEL_6;
219
+ case 33 : return ADC1_CHANNEL_5;
220
+ case 32 : return ADC1_CHANNEL_4;
221
+ case 37 : return ADC1_CHANNEL_1;
222
+ case 38 : return ADC1_CHANNEL_2;
222
223
}
223
224
return ADC1_CHANNEL_MAX;
224
225
}
You can’t perform that action at this time.
0 commit comments