|
@@ -159,14 +159,14 @@ static inline int freeMemory() {
|
159
|
159
|
|
160
|
160
|
#define HAL_ANALOG_SELECT(pin) pinMode(pin, INPUT)
|
161
|
161
|
|
162
|
|
-inline void HAL_adc_init() {}
|
163
|
|
-
|
164
|
162
|
#define HAL_ADC_VREF 3.3
|
165
|
|
-#define HAL_ADC_RESOLUTION 10
|
|
163
|
+#define HAL_ADC_RESOLUTION ADC_RESOLUTION // 12
|
166
|
164
|
#define HAL_START_ADC(pin) HAL_adc_start_conversion(pin)
|
167
|
165
|
#define HAL_READ_ADC() HAL_adc_result
|
168
|
166
|
#define HAL_ADC_READY() true
|
169
|
167
|
|
|
168
|
+inline void HAL_adc_init() { analogReadResolution(HAL_ADC_RESOLUTION); }
|
|
169
|
+
|
170
|
170
|
void HAL_adc_start_conversion(const uint8_t adc_pin);
|
171
|
171
|
|
172
|
172
|
uint16_t HAL_adc_get_result();
|