Skip to content

Commit

Permalink
🐛 Fix missing ADC method
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 26, 2021
1 parent d7af619 commit 57315f0
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 22 deletions.
2 changes: 0 additions & 2 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
3 changes: 0 additions & 3 deletions Marlin/src/HAL/ESP32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/LINUX/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/HAL/NATIVE_SIM/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/SAMD51/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions Marlin/src/HAL/STM32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -240,7 +238,7 @@ class MarlinHAL {
}

// 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); }
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/STM32F1/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/TEENSY31_32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/TEENSY35_36/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/HAL/TEENSY40_41/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down

0 comments on commit 57315f0

Please sign in to comment.