The automatic sync happens when the device first connects to the cloud (plus a few seconds).
But once done it won’t happen again till you lose connection and reconnect again (or call Particle.syncTime()
).
So you should just need to wait a few seconds till the connection was established and the auto-sync has happened and set your own time after that.
For testing you may even want to use a Particle.function()
to set any arbitrary time on-the-fly.
BTW, you can’t change the SYSTEM_MODE at runtime but you don’t need to either. Once your program runs you can use Particle.disconnect()
and Particle.connect()
to control the cloud connection at your will.
Also no need for an interrupt, you can also poll the state of any pin and act upon that.