-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
esp32/Makefile: Include all driver/*.c in build. Fixes #4869 #4874
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
esp32/Makefile: Include all driver/*.c in build. Fixes #4869 #4874
Conversation
It could be an improvement that more directories automatically include their .c/.o files. Not just ESPIDF_DRIVER, but I felt that was out of scope for this change. I want to keep this PR small since its blocking me downstream from being synced to #master. We can discuss making this change more generic in a follow up issue, if that is of interest. |
ports/esp32/Makefile
Outdated
rtc_module.o \ | ||
) | ||
ESPIDF_DRIVER_C = $(wildcard $(ESPCOMP)/driver/*.c) | ||
ESPIDF_DRIVER_O = $(ESPIDF_DRIVER_C:.c=.o) |
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.
How about combining this into one declaration, to avoid the need to define ESPIDF_DRIVER_C
?
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.
Honestly, I don't know how to get make to do that in one line. It seems to evaluate the replace before the wildcard, and just breaks.
If you know how, shoot. Otherwise, I'll look in to it further.
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.
Try using patsubst, see py/py.mk for examples.
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.
Its one line now.
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.
patsubst
needs the whole path to be satisfied which elongates the line by a substantial amount, even with the $(ESPCOMP)
variable. subst
, though not as safe, seems perfectly sufficient.
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.
Yes it looks ok with subst
e2610c5
to
49f2b09
Compare
49f2b09
to
3a6fc47
Compare
Whoops, misunderstanding regarding real name and real email. This PR should be all good. |
A last minute thought, do you want me to rebase this on top of your travis changes so that we get an ESP32 build confirmation? |
No it's ok, I'll test and rebase during merging. |
Great, thanks. |
Thanks for the work, merged in 2f262d5 |
Thanks for reviewing and merging, I'm happy to say we are now tracking micropython#master again 👍 |
For RP2040 boards, we now change the default flash size based on the configured flash. We will still try to read the size from the flash first. Fixes micropython#4874
Small change to import all drivers in the ESP32 port. This allows writing modules, internally or externally with the cmodules functionality that can use these ESP32 drivers.
For me personally, this allows me to write a cmodule that uses the I2S peripheral without modifying the Makefile.
A snippet of the
make
process showing the files included:Here is a screenshot of me initializing the I2S hardware via MicroPython, possible due to this change. (Python & CModule library not provided)

Discussion and issue initially raised here: #4869