Problem
In my personal project, I have a structure defined in the UART abstraction library (let it be called UART.c and UART.h), which I did for AVR.
In UART.h:
typedef struct ST_UARTRX_MESSAGECONTENTS{
uint8_t u_command[3];
uint32_t u32_value;
boolean b_newValue;
boolean b_Error;
} ST_UARTRX_MESSAGECONTENTS;
volatile ST_UARTRX_MESSAGECONTENTS st_uartRX_MessageContents;
Thus, basically it is a structure that contains a UART message, has "b_newValue", which is the flag for receiving a new message. The message is "received" when the AVR receives a new line "\ n".
In the header file of another file (call "foo.h"): I include my "UART abstraction library" and put it in the header:
extern volatile ST_UARTRX_MESSAGECONTENTS st_uartRX_MessageContents;
But then in foo.c, I try to access "b_newValue":
if(st_uartRX_MessageContents.b_newValue){
st_uartRX_MessageContents.b_newValue = TRUE;
fsm_state = ST_STOREMACRO;
}
But "if" is never entered, even if my debugger says that the value of struct is really true:

, if. "Step", !
typedef :
typedef enum{FALSE, TRUE} boolean;
,
ASM, , R24 b_newValue, 0x00, 0x01, .
uartTX_sendArray(st_uartRX_MessageContents.u_command, sizeof st_uartRX_MessageContents.u_command);
delay_ms(2000);
if(st_uartRX_MessageContents.b_newValue){
st_uartRX_MessageContents.b_newValue = TRUE;
fsm_state = ST_STOREMACRO;
}
"UART: ", ascii , ! , foo.c "", "b_newValue" .
. , .