Update lpc176x framework version requirement (#15868)
This commit is contained in:
parent
48b7a1e66e
commit
86d0bc1af5
|
@ -131,14 +131,13 @@ int freeMemory();
|
||||||
// K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
|
// K = 6, 565 samples, 500Hz sample rate, 1.13s convergence on full range step
|
||||||
// Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
|
// Memory usage per ADC channel (bytes): 4 (32 Bytes for 8 channels)
|
||||||
|
|
||||||
#define HAL_ADC_RESULT_BITS 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_ADC_RESOLUTION HAL_ADC_RESULT_BITS
|
|
||||||
|
|
||||||
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
||||||
extern uint32_t HAL_adc_reading;
|
extern uint32_t HAL_adc_reading;
|
||||||
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
||||||
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESULT_BITS); // returns 16bit value, reduce to required bits
|
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
||||||
}
|
}
|
||||||
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
||||||
return HAL_adc_reading;
|
return HAL_adc_reading;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#if PIO_PLATFORM_VERSION < 000001000
|
#if PIO_PLATFORM_VERSION < 000001000
|
||||||
#error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically."
|
#error "nxplpc-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries. You may need to remove the platform and let it reinstall automatically."
|
||||||
#endif
|
#endif
|
||||||
#if PIO_FRAMEWORK_VERSION < 000002000
|
#if PIO_FRAMEWORK_VERSION < 000002001
|
||||||
#error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries."
|
#error "framework-arduino-lpc176x package is out of date, Please update the PlatformIO platforms, frameworks and libraries."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue