Skip to content

#ifdef conditional for specific ESP32 board #2746

Closed
@cweinhofer

Description

@cweinhofer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions