wovo / hwlib

C++ OO micro-controller library for close-to-the-hardware programming
Boost Software License 1.0
58 stars 26 forks source link

Changed the way ADC pins are read in the Teensy 4.0 #38

Closed OscarKro closed 3 years ago

OscarKro commented 3 years ago

ADC pins use a while loop during the read to wait for a certain bit. When one ADC pin is used, eveything worked fine, when two or more pins where used, it wouldn't work anymore as every read call would read out the data register to fast without letting the converter do its work. Changed the wait for COCO bit, tested thoroughly, everything works as it should.