This is probably a first for the Community, but I am wondering why the following works?
I am developing an application with RFID cards. I copied some example code out of the Arduino world that is structured as follows:
loop() {
while( … ) { // wait for an RFID card to be presented
}
// execute some RFID card interaction code here
}
I neglected to explicitly enable the system thread, and yet this code does not crash, even after 15 hours stuck in the tight while() loop. My question is: why does this not crash? My understanding is that the default is for the system thread to be disabled and therefore loop() must complete periodically or else the cloud connection will be lost. But this isn’t happening in my Photon based test setup. The code executes fine and the cloud connection is maintained (at least, the Photon is breathing cyan, the code is executing fine, the Photon shows up as cloud connected in the IDE and Console, etc).
Has the default for threaded operation changed? Also, if I port this code over to an Argon to do the same task while also operating as a Mesh gateway, will this structure hinder Mesh operations? Will explicitly enabling the system thread be helpful, or is this the new default anyway?