|
@@ -156,17 +156,17 @@ int freeMemory();
|
156
|
156
|
|
157
|
157
|
using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
|
158
|
158
|
extern uint32_t HAL_adc_reading;
|
159
|
|
-[[gnu::always_inline]] inline void HAL_start_adc(const pin_t pin) {
|
|
159
|
+[[gnu::always_inline]] inline void HAL_adc_start_conversion(const pin_t pin) {
|
160
|
160
|
HAL_adc_reading = FilteredADC::read(pin) >> (16 - HAL_ADC_RESOLUTION); // returns 16bit value, reduce to required bits
|
161
|
161
|
}
|
162
|
|
-[[gnu::always_inline]] inline uint16_t HAL_read_adc() {
|
|
162
|
+[[gnu::always_inline]] inline uint16_t HAL_adc_get_result() {
|
163
|
163
|
return HAL_adc_reading;
|
164
|
164
|
}
|
165
|
165
|
|
166
|
166
|
#define HAL_adc_init()
|
167
|
167
|
#define HAL_ANALOG_SELECT(pin) FilteredADC::enable_channel(pin)
|
168
|
|
-#define HAL_START_ADC(pin) HAL_start_adc(pin)
|
169
|
|
-#define HAL_READ_ADC() HAL_read_adc()
|
|
168
|
+#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
|
169
|
+#define HAL_READ_ADC() HAL_adc_get_result()
|
170
|
170
|
#define HAL_ADC_READY() (true)
|
171
|
171
|
|
172
|
172
|
// Test whether the pin is valid
|