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

[PoC] drivers/adc_ng: Common ADC API and implementation #13248

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpu/atmega_common/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FEATURES_PROVIDED += cpu_core_atmega
FEATURES_PROVIDED += atmega_pcint0
FEATURES_PROVIDED += dbgpin
FEATURES_PROVIDED += periph_cpuid
FEATURES_PROVIDED += periph_adc_ng
Copy link
Contributor

@gschorcht gschorcht Feb 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be defined in board definitions. Otherwise, a board is not able to use only an external ADC if the feature is provided by the MCU because of the following condition in adc_ng.c:

#if (ADC_NG_NUMOF == 1) && defined(MODULE_PERIPH_ADC_NG)
See also #13247 (comment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Features and modules are conceptional not the same, even though for most (all?) features with periph_% a module with the same name exists and is automatically used, if the corresponding feature is used.

So: Just because the feature is provided, it is not automatically used. The FEATURES_OPTIONAL += periph_adc_ng in drivers/Makefile.dep that is done when adc_ng is used would indeed pull that feature (and therefore) the corresponding module in. But that could be prevented by FEATURES_BLACKLIST += periph_adc_ng.

I'm not sure if this is super elegant. Maybe it would be better to provide an adc_ng_default pseudo-module that would pull in all ADC-NG backends supported by a board.

FEATURES_PROVIDED += periph_eeprom
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
FEATURES_PROVIDED += periph_pm
Expand Down
Loading