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

Compile error on Micro:bit #1

Open
idreamsi opened this issue Feb 20, 2020 · 3 comments
Open

Compile error on Micro:bit #1

idreamsi opened this issue Feb 20, 2020 · 3 comments

Comments

@idreamsi
Copy link

Hi,
I use Arduino 1.8.11 and Micro:bit, at compile time (SoftwareSerialExample.ino), the following error is displayed, what is the problem?

C:\Users\Royal\Documents\Arduino\libraries\SoftwareSerial/SoftwareSerial.h:197:19: error: void value not ignored as it ought to be

          _intMask = attachInterrupt(_receivePin, handle_interrupt, RISING);

                   ^
C:\Users\Royal\Documents\Arduino\libraries\SoftwareSerial/SoftwareSerial.h:202:19: error: void value not ignored as it ought to be

          _intMask = attachInterrupt(_receivePin, handle_interrupt, FALLING);

                   ^
exit status 1
Error compiling for board BBC micro:bit.
@micooke
Copy link
Owner

micooke commented Feb 20, 2020

The attachInterrupt() function from your board core is a void function, so try another board support package that returns an int from attachInterrupt()

@idreamsi
Copy link
Author

Thanks,
Does this mean that Micro:bit is not supported? Unfortunately, I still could not solve the problem.

@micooke
Copy link
Owner

micooke commented Feb 23, 2020

No, it's to do with whatever board support package you use.
If you are using Sandeeps BSP then it needs this sandeepmistry/arduino-nRF5#205
Yes, it's been there a while. The change you need is in WInterrupts.c. And FYI, it's not a hack - it changes the implementation of attachInterrupt() to be inline with the Arduino BSPs

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