2

I'm trying to communicate between two Arduino Due and Nano. Nano as Master and Due as a slave. As given in the library description Wire Lib

When the master request for data from the slave, first it goes to Request ISR. Wire.onRequest(requestEvent) But when compile the program for Arduino Due I get following errors.

In file included from C:\Users\\Slave_Test3.ino:14:0:


C:\Users\..\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\libraries\Wire\src/Wire.h:59:7: error:   initializing argument 1 of 'void TwoWire::onRequest(void (*)())' [-fpermissive]



 void onRequest(void(*)(void));

       ^

But If I change from Arduino Due to any other board this error does not come.

Thank you

1
  • It looks like a problem with the Wire lib that the Due BSP includes. Commented Aug 14, 2017 at 13:44

1 Answer 1

1

Dead easy !! (Well only because I had a -fpermissive yesterday :) )

You are trying to implicitly cast, and you can't do that with modern GCC versions (quite rightly).

So you need to explicitly cast the first parameter to void*.

Because this is in a "core" library for the Due I would get the latest version of the board package and see if it goes away. You can turn the check off, but you will need to google on how to do that.

4
  • Thank you for the solution. Yes, I have the latest version of the board package. Still, I'm getting those errors. Can please elaborate your last suggestion I am new to this. Commented Aug 14, 2017 at 14:00
  • Not really because I can't see the code that has the problem. Commented Aug 14, 2017 at 15:01
  • I have written the same come as given here . Commented Aug 14, 2017 at 15:16
  • 1
    That link won't help. This "error" is not in your code, its in Wire.h as per your original post Commented Aug 15, 2017 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.