Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setAveraging 8 and 16 exchanged #9

Closed
pk960 opened this issue Aug 9, 2015 · 1 comment
Closed

setAveraging 8 and 16 exchanged #9

pk960 opened this issue Aug 9, 2015 · 1 comment

Comments

@pk960
Copy link

pk960 commented Aug 9, 2015

ADC is a fantastic piece of code !
During my tests on my small domotic solution, I found that the behaviour of 8 and 16 averaging are exchanged.
The problem comes from the ADC_Module::setAveraging method where the comments are OK but not the code :

  } else if (num <= 8) {
       num = 8;
       // *ADC_SC3_avgs0 = 1;
       // *ADC_SC3_avgs1 = 0;
       setBit(ADC_SC3, ADC_SC3_AVGS1_BIT); // should be clearBit
       clearBit(ADC_SC3, ADC_SC3_AVGS0_BIT); // should be setBit
   } else if (num <= 16) {
       num = 16;
       // *ADC_SC3_avgs0 = 0;
       // *ADC_SC3_avgs1 = 1;
       clearBit(ADC_SC3, ADC_SC3_AVGS1_BIT); // should be setBit
       setBit(ADC_SC3, ADC_SC3_AVGS0_BIT); // should be clearBit
@pedvide
Copy link
Owner

pedvide commented Aug 9, 2015

I corrected that bug already at some point in the past, it's fixed in the latest version.
Thanks anyway!

@pedvide pedvide closed this as completed Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants