Hello,
I tried to load the same program on an Electron and a Photon device. While the code load and run perfectly well on the Photon device (0.4.9). It refuse to compile for the Electron device unless I comment out the line:
void setup() {
...
//System.on(reset, reset_handler);
...
}
If I don’t do that, I get the following error through the WebIDE:
stabilitytest2.cpp: In function 'void setup()':
stabilitytest2.cpp:104:33: error: invalid conversion from 'void (*)()' to 'void (*)(system_event_t, uint32_t, void*) {aka void (*)(long long unsigned int, long unsigned int, void*)}' [-fpermissive]
^
In file included from ../wiring/inc/spark_wiring.h:47:0,
from ./inc/application.h:36,
from stabilitytest2.cpp:2:
../wiring/inc/spark_wiring_system.h:101:17: error: initializing argument 2 of 'static bool SystemClass::on(system_event_t, void (*)(system_event_t, uint32_t, void*))' [-fpermissive]
static bool on(system_event_t events, void(*handler)(system_event_t, uint32_t,void*)) {
^
My Electron device was running on v0.4.8-rc6 first, I did upgrade it to v0.5.0-rc.1 to see if it would solve the issue. But I still face the same problem. Is there a difference of behavior between Electron and Photon for System functions? or is it a bug on the Electron device?
Also, I don’t know if this is related or not. But I’ve three timer than run in my code:
Timer timers(10000, print_every_10s);
Timer timerm(60000, print_every_minute);
Timer timerh(3600000, print_every_hour);
On the Photon, all three work perfectly well. On the Electron I’ve valided that the timerm does work (using Serial.print). but not the timerm (and I’ve not waited an hour to test the timerh).
Thank in advance for any help received on this issue.