I want to use SYSTEM_THREAD(ENABLED); to keep background application loop running all the time.
My main loop() function reads data from serial port. Everything works fine when the cellular signal is available. But when the cellular signal goes off (LED blinks green on the electron), the loop() function is getting blocked. And it stops reading data from serial. How can i make loop function running all the time to read data from serial??
I added the following line at the top of the code:
But it is still blocking the loop() function.
Where should i put SYSTEM_THREAD(ENABLED); ??
- Inside setup() function
- Outside setup() function
Thank you in Advance