prampec / arduino-softtimer

Task oriented Arduino programming.
118 stars 35 forks source link

From Arduino version 1.6.6 got error: 'callBack' was not declared in this scope #6

Closed prampec closed 7 years ago

prampec commented 8 years ago

From Arduino version 1.6.6 all previous codes, including all examples fails with a compiler error message like this: 'callBack' was not declared in this scope

prampec commented 8 years ago

This is because it seem that from Arduino 1.6.6 functions needs to be defined before using them as function pointers. I still need to investigate whether this is intended to be a change from 1.6.6, of will be fixed in later versions.

For a quick fix you need to do define a function first like this:

void callBack1(Task* me);
Task t1(2000, callBack1);

If this is a permanent change in Arduino, than all documentation and all Example code needs to be updated accordingly.

prampec commented 8 years ago

This issue will not be fixed in SoftTimer, rather we will wait Arduino to fix this issue in the compiler in later versions. See details: https://github.com/arduino/arduino-builder/issues/50

PhilRounds commented 8 years ago

That seems to be it, thanks. Of course now it can't find PciListener.h somewhere further down the line, but I'm guessing that's my issue.

container commented 8 years ago

I have similar (and many) errors, after moving the Task t1(0, myLoop) below the function definition, as you have suggested, I cant get the PciListener to get included properly. (version 1.6.7)

PhilRounds commented 8 years ago

In Debouncer.h there are two lines:

//#include

include "../PciManager/PciLIstener.h"

Switch which of these two is commented out, and PciListener.h gets included correctly.

prampec commented 7 years ago

Finally I decided to fit all the examples of the SoftTimer to the current requirements of the Arduino compiler, as the authors does not seem to to solve this problem.