Ensure ADC conversion is complete before reading (#11370)

Co-Authored-By: gloomyandy <andy-git@gloomy-place.com>
This commit is contained in:
Scott Lahteine 2018-07-26 03:58:33 -05:00 committed by GitHub
parent b5ed4a1a8c
commit 56fbe3361b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 125 additions and 104 deletions

View file

@ -327,7 +327,8 @@ inline void HAL_adc_init(void) {
#define HAL_START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
#endif
#define HAL_READ_ADC ADC
#define HAL_READ_ADC() ADC
#define HAL_ADC_READY() !TEST(ADCSRA, ADSC)
#define GET_PIN_MAP_PIN(index) index
#define GET_PIN_MAP_INDEX(pin) pin