Other Parts Discussed in Thread: MSP430FR4133
Hello,
I am implementing a data structure using struct defined in a header file. The definition of structure is as follows:
struct node{
unsigned char data;
struct node *next;
}
I have defined a struct pointer as a global variable:
struct node *REC_q;
REC_q = NULL;
This pointer is operated upon by several functions in the main code which reference/ dereference the pointer depending upon presence of data in the data structure.
I am using a isEmpty function to evaluate if this pointer is NULL as follows:
unsigned int isEmpty(struct node *temp) {
if(temp == NULL) {
return 1;
}
else{
return 0;
}
}
Even if the value of pointer is 0x0000, the isEmpty function returns 0. I am single stepping the code and getting this result.
Note: I am using MSP430FR4133 launchpad with CCS v6.1 (OS is Win7)
Please help me with this. I think I am missing volatile keyword somewhere/ something similar.
Thanks.