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

Compatibility for Arduino IDE 1.5+ #13

Open
spaelectronics opened this issue Feb 18, 2016 · 10 comments
Open

Compatibility for Arduino IDE 1.5+ #13

spaelectronics opened this issue Feb 18, 2016 · 10 comments

Comments

@spaelectronics
Copy link

Arduino no longer handles inline functions the same.

To make this code work, I had to add the following to the EggDuino.ino

// Function prototypes
void sendAck(void);
void sendError(void);
void loadPenPosFromEE(void);
void storePenUpPosInEE(void);
void storePenDownPosInEE(void);

@krikz
Copy link

krikz commented Feb 26, 2016

rename functions.ino to _functions.ino

@spaelectronics
Copy link
Author

Tried that, it still threw errors.

@krikz
Copy link

krikz commented Feb 26, 2016

and reorder methot loadPenPosFromEE body before initHardware in Hepler_Functions.ino

@spaelectronics
Copy link
Author

Okay, well I'm going to stick with my method, as it's a more "future proof" way of doing it.

I was just throwing out there that you should fix the code for IDE 1.5+

@caravanserei
Copy link

I encountered the same problems with the latest IDE 1.6.7 and could get rid of the compiler error messages by simply swapping every "void inline" to "inline void". This method is not as future-proof as spaelectronics', but provides a smooth compilation, too ;-)

@spaelectronics
Copy link
Author

Interesting.. I'll have to check that out.

@caravanserei
Copy link

By the way: I get similar problems with different error messages when I try to simply activate the outcommented button defines in IDE 1.6.7. The Compiler runs smooth again, when a prototype for the called functions (setprgButtonState etc.) is added just above the object creation or, better, in button.h ...

@urs8000
Copy link

urs8000 commented Mar 16, 2016

using 1.6.7: I just deleted all "inline" in Helper_Functions; "inline void" also works

@Viper-Gtr
Copy link

@caravanserei
I have this problem too. But how do you resolve exactly?

@caravanserei
Copy link

@Viper-Gtr
As I wrote: simply declare a prototype before the function is called first time. You can do this either in button.h (where a vintage C-programmer most likely would place it ;-) or, alternatively, do it immediately before the C++ function creation is called like this. A prototype is not a real function call (you will not find this line in the µC-code) but a sort of structuring help for the compiler/linker.

Usually the Arduino environment keeps those formalistic details of the real C-world away from you; but obviously something has changed recently...

#ifdef prgButton
void setprgButtonState(void);
Button prgButtonToggle(prgButton, setprgButtonState);
#endif

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

5 participants