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

SPI1 & SPI2 need compiler better compiler error messages. #32

Open
Donziboy2 opened this issue Dec 8, 2017 · 2 comments
Open

SPI1 & SPI2 need compiler better compiler error messages. #32

Donziboy2 opened this issue Dec 8, 2017 · 2 comments

Comments

@Donziboy2
Copy link

If you use SPI1 or SPI2 and compile for a Teensy 3.2/3.1 it gives a generic error .

error: 'SPI1' was not declared in this scope
SPI1.begin();

If possible it would be nice to say these functions are only usable in T3.5/T3.6 instead of a generic error message that we get. Took me about 2 hours to figure out why it was throwing errors.

@tonton81
Copy link

tonton81 commented Apr 12, 2018

that hardware is defined for devices that use it

if your attempting to access hardware not available, obviously you would d get that error.
This is not a “bug”, nor should code be bloated to tell users to switch to a different MCU to use hardware that doesn't exist on theirs...

@PaulStoffregen
Copy link
Owner

There is some code in the Arduino IDE to detect certain cases and print friendly messages. It can be found in message_advice_Teensy() in Compiler.java.

https://github.com/PaulStoffregen/Arduino-1.8.5-Teensyduino/blob/master/arduino-core/src/cc/arduino/Compiler.java#L686

But as you can see, it's not written to be customized depending on which board is selected. It also looks only for fixed strings in English, which doesn't work when the compiler it localized to another language. Eventually I would like to greatly improve this code, allowing the IDE to parse the compiler messages in any language and to get these messages from a text file that can be customized per platform and per board without editing the Java code.

Sadly, this is a low priority compared to so many other projects.....

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

3 participants