-
Notifications
You must be signed in to change notification settings - Fork 271
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
BusIO library won't build unless a serial device is configured #127
Comments
That's probably expected behavior for the scenario. Not having As a work around, can try just deleting |
This looks like a dupe of #111 |
Disabling the serial device is a supported configuration; having to edit the library to make it work is very much unexpected behaviour... What I'm specifically trying to do here is to use SoftwareSerial instead of the hard-coded Serial, as the pins that Serial uses by default are in use for something else. I couldn't find any way to configure this that would make BusIO compile; there don't seem to be any user hooks to allow me to declare my own Serial device before the BusIO headers get included. The obvious trick of just defining Regarding deleting the Register classes: I am not using these directly; they're getting included by Adafruit_GFX, which I don't have any control over. |
Is there a known way to check for this across all platforms? The preprocessor logic in this PR doesn't seem to work in the case of STM32 BSP: Adding that to your basic test sketch: #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
#include <Adafruit_SPIDevice.h>
#endif
void setup() {}
void loop() {} still produces the compile time fail. This works however: #if !defined(NDEBUG)
#include <Adafruit_SPIDevice.h>
#endif
void setup() {}
void loop() {} since that is what the STM32 BSP seems to add via a It seems like each BSP does their own thing? |
Adafruit_BusIO_Register.h
contains these prototypes:If I try to configure my platform without a generic Serial instance, then compilation of the BusIO libraries fails with a 'Serial not declared' error. I feel like these two prototypes (and the implementation in the
.cpp
file, of course) should probably be guarded with something so that they're only included if a Serial instance is present, but I don't know what that would be.(Alternatively, this might be an STM32Duino issue where it's not doing the right thing if you disable the automatic serial port --- please let me know.)
Disable the serial port via the Tools menu, and compile. You get:
The text was updated successfully, but these errors were encountered: