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

Deprecated APIs in ADC class #27

Open
josiahdelange opened this issue Sep 25, 2020 · 0 comments
Open

Deprecated APIs in ADC class #27

josiahdelange opened this issue Sep 25, 2020 · 0 comments

Comments

@josiahdelange
Copy link

Hi,

I noticed some errors in power.cpp (in PowerMonitor::PowerMonitor(...)) that seem to be due to some recent commits to the ADC class (see: here and here).

My workaround is using the "set" methods of each ADC module (adc.adc0 or adc.adc1), i.e., changing

adc.setReference(ADC_REFERENCE::REF_1V2, ADC_0);
adc.setAveraging(1, ADC_0);                                       // set number of averages
adc.setResolution(16, ADC_0);                                     // set bits of resolution
adc.setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED, ADC_0);  // change the conversion speed
adc.setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED, ADC_0);      // change the sampling speed

adc.setReference(BOARD_ADC_REF, ADC_1);
adc.setAveraging(1, ADC_1);                                       // set number of averages
adc.setResolution(16, ADC_1);                                     // set bits of resolution
adc.setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED, ADC_1);  // change the conversion speed
adc.setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED, ADC_1);      // change the sampling speed

to

adc.adc0->setReference(ADC_REFERENCE::REF_1V2);
adc.adc0->setAveraging(1);                                       // set number of averages
adc.adc0->setResolution(16);                                     // set bits of resolution
adc.adc0->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED);  // change the conversion speed
adc.adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED);      // change the sampling speed

adc.adc1->setReference(BOARD_ADC_REF);
adc.adc1->setAveraging(1);                                       // set number of averages
adc.adc1->setResolution(16);                                     // set bits of resolution
adc.adc1->setConversionSpeed(ADC_CONVERSION_SPEED::HIGH_SPEED);  // change the conversion speed
adc.adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::HIGH_SPEED);      // change the sampling speed

Curious if anyone else has seen this yet - may be something to roll into the development branch, if possible.

Thanks!
-Josiah

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

1 participant