mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-28 14:24:34 +00:00
🐛 Fix missing ADC method
This commit is contained in:
parent
d7af619936
commit
57315f02cb
@ -131,8 +131,6 @@ typedef Servo hal_servo_t;
|
|||||||
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
|
#define analogInputToDigitalPin(p) ((p < 12U) ? (p) + 54U : -1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(ch)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pin Mapping for M42, M43, M226
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
@ -85,9 +85,6 @@ void noTone(const pin_t _pin);
|
|||||||
|
|
||||||
void analogWrite(pin_t pin, int value);
|
void analogWrite(pin_t pin, int value);
|
||||||
|
|
||||||
// ADC
|
|
||||||
#define HAL_ANALOG_SELECT(pin)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pin Mapping for M42, M43, M226
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
@ -82,7 +82,6 @@ extern MSerialT usb_serial;
|
|||||||
// ADC
|
// ADC
|
||||||
#define HAL_ADC_VREF 5.0
|
#define HAL_ADC_VREF 5.0
|
||||||
#define HAL_ADC_RESOLUTION 10
|
#define HAL_ADC_RESOLUTION 10
|
||||||
#define HAL_ANALOG_SELECT(ch) hal.adc_enable(ch)
|
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
// Class Utilities
|
// Class Utilities
|
||||||
|
@ -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_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_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
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
@ -117,7 +117,6 @@ extern MSerialT serial_stream_3;
|
|||||||
|
|
||||||
#define HAL_ADC_VREF 5.0
|
#define HAL_ADC_VREF 5.0
|
||||||
#define HAL_ADC_RESOLUTION 10
|
#define HAL_ADC_RESOLUTION 10
|
||||||
#define HAL_ANALOG_SELECT(ch) hal.adc_enable(ch)
|
|
||||||
|
|
||||||
/* ---------------- Delay in cycles */
|
/* ---------------- Delay in cycles */
|
||||||
|
|
||||||
|
@ -106,8 +106,6 @@ typedef Servo hal_servo_t;
|
|||||||
// ADC
|
// ADC
|
||||||
//
|
//
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin)
|
|
||||||
|
|
||||||
//#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values.
|
//#define HAL_ADC_FILTERED // Disable Marlin's oversampling. The HAL filters ADC values.
|
||||||
#define HAL_ADC_VREF 3.3
|
#define HAL_ADC_VREF 3.3
|
||||||
#define HAL_ADC_RESOLUTION 10 // ... 12
|
#define HAL_ADC_RESOLUTION 10 // ... 12
|
||||||
|
@ -142,8 +142,6 @@ typedef libServo hal_servo_t;
|
|||||||
// ADC
|
// ADC
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
|
|
||||||
|
|
||||||
#ifdef ADC_RESOLUTION
|
#ifdef ADC_RESOLUTION
|
||||||
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
||||||
#else
|
#else
|
||||||
@ -240,7 +238,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called by Temperature::init for each sensor at startup
|
// 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
|
// Begin ADC sampling on the given channel
|
||||||
static void adc_start(const pin_t pin) { adc_result = analogRead(pin); }
|
static void adc_start(const pin_t pin) { adc_result = analogRead(pin); }
|
||||||
|
@ -188,8 +188,6 @@ extern uint16_t HAL_adc_result;
|
|||||||
// ADC
|
// ADC
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT_ANALOG);
|
|
||||||
|
|
||||||
#ifdef ADC_RESOLUTION
|
#ifdef ADC_RESOLUTION
|
||||||
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
#define HAL_ADC_RESOLUTION ADC_RESOLUTION
|
||||||
#else
|
#else
|
||||||
|
@ -105,8 +105,6 @@ uint32_t __get_PRIMASK(void); // CMSIS
|
|||||||
#define HAL_ADC_VREF 3.3
|
#define HAL_ADC_VREF 3.3
|
||||||
#define HAL_ADC_RESOLUTION 10
|
#define HAL_ADC_RESOLUTION 10
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pin Mapping for M42, M43, M226
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
@ -110,8 +110,6 @@ typedef int8_t pin_t;
|
|||||||
#define HAL_ADC_VREF 3.3
|
#define HAL_ADC_VREF 3.3
|
||||||
#define HAL_ADC_RESOLUTION 10
|
#define HAL_ADC_RESOLUTION 10
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pin Mapping for M42, M43, M226
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
@ -129,8 +129,6 @@ typedef int8_t pin_t;
|
|||||||
#define HAL_ADC_RESOLUTION 10
|
#define HAL_ADC_RESOLUTION 10
|
||||||
#define HAL_ADC_FILTERED // turn off ADC oversampling
|
#define HAL_ADC_FILTERED // turn off ADC oversampling
|
||||||
|
|
||||||
#define HAL_ANALOG_SELECT(pin)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Pin Mapping for M42, M43, M226
|
// Pin Mapping for M42, M43, M226
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user