-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards/esp32: changes the approach for configurations of ADC channels in board definitions #11289
boards/esp32: changes the approach for configurations of ADC channels in board definitions #11289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two comments, otherwise looks good to me.
75db4ec
to
983afdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the ADC and GPIOs on esp32-wroom-32 and everything is working fine. ACK but we should wait the other PRs.
@gschorcht please squash |
983afdf
to
e31c232
Compare
@leandrolanzieri Squashed. Thanks a lot for reviewing and testing.
Ok. When we start to merge, we should start with this PR so that I can rebase all related PRs before they are merged. |
Mmm @gschorcht murdock is failing. Maybe |
Nope, periph_adc passes. For some reason adc.c is tried to be compiled for all applications. |
@leandrolanzieri Hm, ...
And now I remember that this was the reason why I had the variable |
@leandrolanzieri I can try to embed it in |
Is there a way to change this dependency? |
Yes, I will provide a fix. |
@leandrolanzieri Commit 66f7742 should fix the problem. Let's see what murdock says. |
5047048
to
66f7742
Compare
@leandrolanzieri The last commit solved the problem. I required, I could squash again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gschorcht Though last changes fix the compiling problem I'm not sure if this is the correct way to handle this dependency issue. Looking at other CPUs I can see that it is common in RIOT to include some periph
module directly in the CPU Makefile.include, so it's clear that the issue is out of the scope of this PR.
We could merge this as a temporary solution while the dependencies are fixed. Maybe @haukepetersen @jcarrano or @kaspar030 have a better idea on how to proceed?
@leandrolanzieri @MrKevinWeiss The changes for all periphs are now tested and working. Do you think we should merge them before branch 2019.4 is created to release it with 2019.4? If so, we would have to do it at latest tomorrow since I'm not in the office from Friday to Thursday next week. |
@gschorcht I think we should address the peripheral dependency issue first. @cladmi has pointed out that the peripheral directory should be specified differently, by including |
I see, I have tried it and it compiles indeed only the How do we proceed. Should I provide a PR with required changes in |
Yes, please do that on a separate PR. |
Exactly. |
@leandrolanzieri Hm, ... there is one problem with the |
Is there a way to extract this common initialization? |
Unfortunatly not without bigger structure changes. |
@leandrolanzieri In PR #11337, you will find the changes for
|
Thanks for addressing the issue so quickly.
IMHO fixing these dependencies is important in general, not just for this PR, and should be addressed before this cleanup. @cladmi do you have any opinion on this?
Aren't some changes going to be needed anyways if #11289 - #11294 are merged before #11337? I'm happy to review and test them again. |
Yes, but it seems easier for me to keep my branches and the changes in PR #11289 - #11294 consistent if we merge the changes in this PR first and then rebase PR #11337 than to wait with all the different branches until PR #11337 is merged. I planned to continue with changes of peripherals that are not affected by PR #11337. |
@leandrolanzieri How do we continue with the bunch of this PRs that are ready and PR #11371 that requires a review and is a structural change? |
The GPIO definitions defined here are required in this file to be able to use them in peripheral configurations.
ADC pins are now configured using static arrays in header files instead of static variables in implementation to be able to define ADC_NUMOF using the size of these arrays instead of a variable.
ADC pins are now configured using static arrays in header files instead of static variables in implementation to be able to define ADC_NUMOF using the size of these arrays instead of a variable.
66f7742
to
3db78e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I tested again and everything seems fine. ACK.
@leandrolanzieri Thanks a lot. |
Contribution description
This PR changes the approach of peripheral configurations for ADC in board definitions to the usual RIOT approach. With these changes, peripheral configurations use static const arrays in the
boards/esp32*/periph_conf.h
files and define the*_NUMOF
macros using the size of these static array.The static configuration arrays contain only definitions that can be changed by the board definition or the application. They do not contain any MCU implementation detail. The board definitions use preprocessor defines as before to fill these static configuration arrays. This makes it possible to override all configurations either with the make command or application specific configuration files.
Testing procedure
Compilation and test with the most common ESP32 board should be executed
Issues/PRs references
PRs #11289 #11290 #11291 #11292 #11293 #11294 are releated and should be merged together.