Skip to content

boards.txt board define issue for "WeMos D1 R1" board #4303

Closed
@bperrybap

Description

@bperrybap

The board specific define for "WeMos D1 R1" board define in boards.txt needs to be changed.
Currently it us using ESP8266_WEMOS_D1MINI

d1.name=WeMos D1 R1
d1.build.board=ESP8266_WEMOS_D1MINI
d1.build.variant=d1

The "WeMos D1 R1" board define should be changed to something different, perhaps something like ESP8266_WEMOS_D1 or ESP8266_WEMOS_D1R1 to indicate it is using a different variant than other Wemos "mini" boards.

d1.name=WeMos D1 R1
d1.build.board=ESP8266_WEMOS_D1R1
d1.build.variant=d1

The current board define of "ESP8266_WEMOS_D1MINI" is being used by other boards that are using the d1_mini variant.

d1_mini.name=WeMos D1 R2 & mini
d1_mini.build.board=ESP8266_WEMOS_D1MINI
d1_mini.build.variant=d1_mini
d1_mini.name=WeMos D1 R2 & mini
d1_mini.build.board=ESP8266_WEMOS_D1MINI
d1_mini.build.variant=d1_mini
d1_mini_pro.name=WeMos D1 mini Pro
d1_mini_pro.build.board=ESP8266_WEMOS_D1MINIPRO
d1_mini_pro.build.variant=d1_mini

Because of this "mini" board define being re-used by boards using different variants, there is no way for conditional compilation to tell the difference between a board using the d1_mini variant and the d1 variant.
It can make difference to some applications (I have a i2c diagnostic sketch that is one such sketch).

More details:

Each board in the boards.txt file can set a board specific define set in xx.build.board
While multiple boards can point to the same variant, using the same board define in multiple boards that points use variants creates issues.
For example,
"WeMos D1 R2 & mini" and "WeMos D1 mini Pro" both use the same variant "d1_mini" but each uses its own unique board define.
This does not create a problem.

What creates a problem is when two different boards, use the same board define but different variants.
For example:
"WeMos D1 R2 & mini" board uses board define: ESP8266_WEMOS_D1MINI
"WeMos D1 R1" board also uses board define: ESP8266_WEMOS_D1MINI
This is a problem since code that may want to know which variant is being used can't tell because the IDE does not pass in any variant information. The IDE only passes in a board name define and by using the same board define for different boards, there is no way to tell the boards apart.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions