Skip to content

#ifdef conditional for specific ESP32 board #2746

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

Closed
cweinhofer opened this issue May 6, 2019 · 4 comments
Closed

#ifdef conditional for specific ESP32 board #2746

cweinhofer opened this issue May 6, 2019 · 4 comments
Labels
Status: Stale Issue is stale stage (outdated/stuck)

Comments

@cweinhofer
Copy link
Contributor

If I want to do a logical test for a specific board in the ESP32 list, how do I figure out what to put in the #ifdef conditional?

I'll give my board as an example, although I'm hoping for information that can be used to make a conditional for any specific board in the ESP32 family.

In my case, I need to assign specific pin when my sketch is loaded onto a LOLIN D32 PRO. So, I need to create a conditional similar to what is shown in . I am assuming that the define would be based on something in the ESP32 boards.txt. Based on the D32 Pro's entry which is
d32_pro.build.board=LOLIN_D32_PRO
I have tried
#ifdef LOLIN_D32_PRO
#ifdef d32_pro
and
#ifdef ESP_LOLIN_D32_PRO
but none of them seem to work. Which leads me to believe I am not using the right thing for the define.

Can someone tell me how to figure out the proper define based on what's in boards.txt?

PS - If it matters, I'm using the Arduino IDE.

@dok-net
Copy link
Contributor

dok-net commented May 6, 2019

Please try ARDUINO_LOLIN_D32_PRO

@cweinhofer
Copy link
Contributor Author

Thanks @dok-net That seems to work.

I would appear then that you put "ARDUINO_" in front of the the build.board name.

This seems strange to me since these are not Arduino boards, but I don't know much about this stuff. Can you share any more about why it works like that? Is it because I'm compiling on the Arduino IDE?

@stale
Copy link

stale bot commented Jul 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Jul 31, 2019
@stale
Copy link

stale bot commented Aug 14, 2019

This stale issue has been automatically closed. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale Issue is stale stage (outdated/stuck)
Projects
None yet
Development

No branches or pull requests

2 participants