Skip to content
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

PlatformIO errors on pins the specific board is missing #75

Closed
Bolukan opened this issue Sep 16, 2018 · 3 comments
Closed

PlatformIO errors on pins the specific board is missing #75

Bolukan opened this issue Sep 16, 2018 · 3 comments

Comments

@Bolukan
Copy link
Contributor

Bolukan commented Sep 16, 2018

Compiling on PlatformIO for the WeMos D1 R2 & mini the compiler errors on

#elif defined ESP8266_WEMOS_D1MINI || defined ESP8266_WEMOS_D1MINILITE || defined ESP8266_WEMOS_D1MINIPRO || defined ESP8266_NODEMCU || defined WIFINFO

		// DEBUG_PRINTLN("- Special ESP's -");
		if      (orgVal == "D0"  || orgVal == "16")   return D0;
		else if (orgVal == "D1"  || orgVal == "5")    return D1;
		else if (orgVal == "D2"  || orgVal == "4")    return D2;
		else if (orgVal == "D3"  || orgVal == "0")    return D3;
		else if (orgVal == "D4"  || orgVal == "2")    return D4;
		else if (orgVal == "D5"  || orgVal == "14")   return D5;
		else if (orgVal == "D6"  || orgVal == "12")   return D6;
		else if (orgVal == "D7"  || orgVal == "13")   return D7;
		else if (orgVal == "D8"  || orgVal == "15")   return D8;
		else if (orgVal == "D9"  || orgVal == "3")    return D9;
		else if (orgVal == "D10" || orgVal == "1")    return D10;
		else                                          return D0;

Lines 1003-1017
as D9 and D10 are not defined for this board. (but called RX and TX).

Not knowing the function of this code, maybe this is not a good solution, but I propose to consider return 3 and 1 in stead?

@Onno-Dirkzwager
Copy link
Collaborator

Onno-Dirkzwager commented Sep 16, 2018

We never had compile errors while testing in Arduino IDE but you are right.

As you migh have noticed this function is also used in case of the nodemcu and wifinfo that do have D9 and D10

So we will have to split this up.

As for why we have this basterd of a function check this wiki page.

@Bolukan
Copy link
Contributor Author

Bolukan commented Sep 16, 2018

Yeah, found the source code of the definition of the pins available for the compiler:

For variant "d1_mini", as the "WeMos D1 R2 & mini", "WeMos D1 mini Lite" and "WeMos D1 mini Pro":
https://github.com/esp8266/Arduino/blob/master/variants/d1_mini/pins_arduino.h

and variant "d1" as the "WEMOS D1 R1 (Retired)":
https://github.com/esp8266/Arduino/blob/master/variants/d1/pins_arduino.h

(edit: post crossed the above)

Onno-Dirkzwager added a commit that referenced this issue Sep 20, 2018
Issue #75 Define pins for specific boards
@Onno-Dirkzwager
Copy link
Collaborator

Closing as you already Pull requested a solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants