I am trying to create a gatekeeper task to display the sensor data over the screen via UART. The attributes are defined in the structure as follows,
typedef struct Peripheral_data
{
volatile char data[5];
char Source[15];
char String[5];
char Nextline[3];
}PeriData;
/****************************************************************************************************************
An array of structures can be declared and initilized according to the need.
****************************************************************************************************************/
static PeriData Peripheral[2] =
{
{ "", "TMPSEN", "Temp:", "\r\n"},
{ "", "Light_Sensor", "Lumos", "\r\n"}
};
But on sending via the queue the Source[0]
of Peripheral[0]
is changing to
\0
from
T
I am attaching screenshots for reference.
Screenshot 1:
This picture shows the initilization of the structure at the beginning.
Screenshot 2:
This picture shows the data present in Source variable for the structure one. Here the data indexed by the 0 in the Source variable is T. But automatically, after sending via the queue, the Source[0] for the first structure becomes zero sir. But sometimes this happens before sending via queue aswell.
Could someone suggest me what could be the problemhere. Moreover I developed this code, around one month back and it ran seamlessly over the same board. The chip am using is lpc 1768.
But when I tried to run the same code now, the above mentioned problem is arising.