I’m a bit of a noob at this, so please forgive me if I’m not seeing things right. It seems there’s a bit of code on line 253 in evnt_handler.c that isn’t doing what I think it would have been intended to.
while (1)
{
if (tSLInformation.usEventOrDataReceived == 0)
{
KICK_WDT();
volatile system_tick_t now = GetSystem1MsTick();
volatile long elapsed = now - start;
if (elapsed < 0) { // Did we wrap
elapsed = start + now; // yes now
}
if (cc3000__event_timeout_ms && (elapsed >= cc3000__event_timeout_ms))
{
It seems like the intention is to break the loop if a timeout occurs. However, the elapsed time function doesn’t calculate the wrap right, and the cc3000__event_timeout_ms is declared as false from the get-go… which seems to invalidate the whole following chunk of code. I tried to find something about this in the community or git, but couldn’t find anything that seemed to address it. Is this code simply unnecessary?
Thanks for any possible help. I’m trying to figure out a way to turn off wifi if the core loses the cloud, and then simply retry every 10 minutes or so. I want to “fix” this piece of code, but I’m not sure if it’s this way for a particular reason that I don’t understand.
Thanks, JB