|
@@ -131,14 +131,13 @@ int freeMemory();
|
131
|
131
|
// K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
|
132
|
132
|
// Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
|
133
|
133
|
|
134
|
|
-#define HAL_ADC_RESULT_BITS 12 // 15 bit maximum, raw temperature is stored as int16_t
|
|
134
|
+#define HAL_ADC_RESOLUTION 12 // 15 bit maximum, raw temperature is stored as int16_t
|
135
|
135
|
#define HAL_ADC_FILTERED // Disable oversampling done in Marlin as ADC values already filtered in HAL
|
136
|
|
-#define HAL_ADC_RESOLUTION HAL_ADC_RESULT_BITS
|
137
|
136
|
|
138
|
137
|
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
139
|
138
|
extern uint32_t HAL_adc_reading;
|
140
|
139
|
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
141
|
|
- HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESULT_BITS); // returns 16bit value, reduce to required bits
|
|
140
|
+ HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
142
|
141
|
}
|
143
|
142
|
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
144
|
143
|
return HAL_adc_reading;
|