AnsweredAssumed Answered

trouble using _lwlog_write() in a loop with a _time_delay()

Question asked by George Joseph on Oct 11, 2016
Latest reply on Oct 12, 2016 by George Joseph

I'm trying to use the log feature of MQX. I'm finding that when I use the _time_delay() function inside my loop the _lwlog_write() function fails. The 2nd time through the loop the log_component_ptr->LOGS[log_number].FLAGS in the function _lwlog_write_internal(...) indicates that the log is disabled. I don't understand why. If don't use the time delay it works fine.

 

void * snapshot_data_ptr = 0x60000000;

/* Create the lightweight log component */
result = _lwlog_create_component();
if (result != MQX_OK)
{
_task_block();
}
/* Create a log */
result = _lwlog_create_at(SNAPSHOT_LOG, 1000, LOG_OVERWRITE, snapshot_data_ptr);
if (result != MQX_OK)
{
_task_block();
}
/* Write data to the log */
while(1) // main task loop
{
_time_delay(1);

// Write to log
result = _lwlog_write(SNAPSHOT_LOG, p1, p2, p3, p4, p5, p6  p7);

}

Outcomes