spigotx / Moodlite

Moodlite
GNU General Public License v3.0
109 stars 17 forks source link

invalid conversion from 'void (*)(void*)' to 'void (*)()' [-fpermissive] #5

Closed tarpey closed 5 years ago

tarpey commented 5 years ago

I'm getting an error on line 454:

trCheckNtpServer.every(TR1H, checkNtpServer, (void*)0);

Error messages:

/Users/James/Documents/Arduino/Moodlite/Moodlite.ino: In function 'void setup()':
Moodlite:454:60: error: invalid conversion from 'void (*)(void*)' to 'void (*)()' [-fpermissive]
       trCheckNtpServer.every(TR1H, checkNtpServer, (void*)0);
                                                            ^
In file included from /Users/James/Documents/Arduino/Moodlite/Moodlite.ino:31:0:
/Users/James/Documents/Arduino/libraries/Timer/Timer.h:19:10: error:   initializing argument 2 of 'int8_t Timer::every(long unsigned int, void (*)(), int)' [-fpermissive]
   int8_t every(unsigned long period, void (*callback)(void), int repeatCount);

          ^
Moodlite:454:60: error: invalid conversion from 'void*' to 'int' [-fpermissive]
       trCheckNtpServer.every(TR1H, checkNtpServer, (void*)0);
                                                            ^
In file included from /Users/James/Documents/Arduino/Moodlite/Moodlite.ino:31:0:
/Users/James/Documents/Arduino/libraries/Timer/Timer.h:19:10: error:   initializing argument 3 of 'int8_t Timer::every(long unsigned int, void (*)(), int)' [-fpermissive]
   int8_t every(unsigned long period, void (*callback)(void), int repeatCount);

          ^
exit status 1
invalid conversion from 'void (*)(void*)' to 'void (*)()' [-fpermissive]

I have to comment it out to compile and upload.

spigotx commented 5 years ago

Which Timer lib do you use? I forgot to add link to timer lib to Readme (fixed). You should use: https://github.com/JChristensen/Timer/tree/v2.1

tarpey commented 5 years ago

Yep, that sorted it. Thanks :thumbsup: