diff --git a/Marlin/src/HAL/DUE/HAL.h b/Marlin/src/HAL/DUE/HAL.h index 5d1d2cf236..96a59fcf3c 100644 --- a/Marlin/src/HAL/DUE/HAL.h +++ b/Marlin/src/HAL/DUE/HAL.h @@ -131,8 +131,6 @@ typedef Servo hal_servo_t; #define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1) #endif -#define HAL_ANALOG_SELECT(ch) - // // Pin Mapping for M42, M43, M226 // diff --git a/Marlin/src/HAL/ESP32/HAL.h b/Marlin/src/HAL/ESP32/HAL.h index 361c903231..138346b950 100644 --- a/Marlin/src/HAL/ESP32/HAL.h +++ b/Marlin/src/HAL/ESP32/HAL.h @@ -85,9 +85,6 @@ void noTone(const pin_t _pin); void analogWrite(pin_t pin, int value); -// ADC -#define HAL_ANALOG_SELECT(pin) - // // Pin Mapping for M42, M43, M226 // diff --git a/Marlin/src/HAL/LINUX/HAL.h b/Marlin/src/HAL/LINUX/HAL.h index c1b7a54997..a2a9692cbd 100644 --- a/Marlin/src/HAL/LINUX/HAL.h +++ b/Marlin/src/HAL/LINUX/HAL.h @@ -82,7 +82,6 @@ extern MSerialT usb_serial; // ADC #define HAL_ADC_VREF 5.0 #define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(ch) hal.adc_enable(ch) // ------------------------ // Class Utilities diff --git a/Marlin/src/HAL/LPC1768/HAL.h b/Marlin/src/HAL/LPC1768/HAL.h index f1cdbe6f07..e1ade3d9a7 100644 --- a/Marlin/src/HAL/LPC1768/HAL.h +++ b/Marlin/src/HAL/LPC1768/HAL.h @@ -133,8 +133,6 @@ extern DefaultSerial1 USBSerial; #define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t #define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL -#define HAL_ANALOG_SELECT(pin) hal.adc_enable(pin) - // // Pin Mapping for M42, M43, M226 // diff --git a/Marlin/src/HAL/NATIVE_SIM/HAL.h b/Marlin/src/HAL/NATIVE_SIM/HAL.h index 0798bdde39..50da5af2eb 100644 --- a/Marlin/src/HAL/NATIVE_SIM/HAL.h +++ b/Marlin/src/HAL/NATIVE_SIM/HAL.h @@ -117,7 +117,6 @@ extern MSerialT serial_stream_3; #define HAL_ADC_VREF 5.0 #define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(ch) hal.adc_enable(ch) /* ---------------- Delay in cycles */ diff --git a/Marlin/src/HAL/SAMD51/HAL.h b/Marlin/src/HAL/SAMD51/HAL.h index 9fcd73e9b6..e9d4a70c3f 100644 --- a/Marlin/src/HAL/SAMD51/HAL.h +++ b/Marlin/src/HAL/SAMD51/HAL.h @@ -106,8 +106,6 @@ typedef Servo hal_servo_t; // ADC // -#define HAL_ANALOG_SELECT(pin) - //#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values. #define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 // ... 12 diff --git a/Marlin/src/HAL/STM32/HAL.h b/Marlin/src/HAL/STM32/HAL.h index c23ddf69bd..f9bf1c938a 100644 --- a/Marlin/src/HAL/STM32/HAL.h +++ b/Marlin/src/HAL/STM32/HAL.h @@ -142,8 +142,6 @@ typedef libServo hal_servo_t; // ADC // ------------------------ -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT) - #ifdef ADC_RESOLUTION #define HAL_ADC_RESOLUTION ADC_RESOLUTION #else @@ -240,7 +238,7 @@ public: } // Called by Temperature::init for each sensor at startup - static void adc_enable(const pin_t pin); + static inline void adc_enable(const pin_t pin) { pinMode(pin, INPUT); } // Begin ADC sampling on the given channel static void adc_start(const pin_t pin) { adc_result = analogRead(pin); } diff --git a/Marlin/src/HAL/STM32F1/HAL.h b/Marlin/src/HAL/STM32F1/HAL.h index 8fb4c9299f..bdbf4a1885 100644 --- a/Marlin/src/HAL/STM32F1/HAL.h +++ b/Marlin/src/HAL/STM32F1/HAL.h @@ -188,8 +188,6 @@ extern uint16_t HAL_adc_result; // ADC // ------------------------ -#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG); - #ifdef ADC_RESOLUTION #define HAL_ADC_RESOLUTION ADC_RESOLUTION #else diff --git a/Marlin/src/HAL/TEENSY31_32/HAL.h b/Marlin/src/HAL/TEENSY31_32/HAL.h index a5f67a50f0..0661b55f53 100644 --- a/Marlin/src/HAL/TEENSY31_32/HAL.h +++ b/Marlin/src/HAL/TEENSY31_32/HAL.h @@ -105,8 +105,6 @@ uint32_t __get_PRIMASK(void); // CMSIS #define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(pin) - // // Pin Mapping for M42, M43, M226 // diff --git a/Marlin/src/HAL/TEENSY35_36/HAL.h b/Marlin/src/HAL/TEENSY35_36/HAL.h index 8ca76dc636..1cc465c4bb 100644 --- a/Marlin/src/HAL/TEENSY35_36/HAL.h +++ b/Marlin/src/HAL/TEENSY35_36/HAL.h @@ -110,8 +110,6 @@ typedef int8_t pin_t; #define HAL_ADC_VREF 3.3 #define HAL_ADC_RESOLUTION 10 -#define HAL_ANALOG_SELECT(pin) - // // Pin Mapping for M42, M43, M226 // diff --git a/Marlin/src/HAL/TEENSY40_41/HAL.h b/Marlin/src/HAL/TEENSY40_41/HAL.h index 10263ecb39..7bad143179 100644 --- a/Marlin/src/HAL/TEENSY40_41/HAL.h +++ b/Marlin/src/HAL/TEENSY40_41/HAL.h @@ -129,8 +129,6 @@ typedef int8_t pin_t; #define HAL_ADC_RESOLUTION 10 #define HAL_ADC_FILTERED // turn off ADC oversampling -#define HAL_ANALOG_SELECT(pin) - // // Pin Mapping for M42, M43, M226 //