Hello!
I'm trying to figure out why my ISR is not entering the if statement.
if(p_ctrl->smb_status_FLAG == SMB_STATE_IDLE)
{
p_ctrl->smb_status_FLAG = SMB_STATE_START; //Next state is START
}
The p_ctrl is a pointer to the structure:
typedef struct st_smb_instance_ctrl
{
volatile smb_state_t smb_status_FLAG;
/* Current transfer information. */
uint8_t * p_buff; /**< Holds the data associated with the transfer */
uint8_t rec_buff[SMB_REG_TAB_LEN]; /**< Holds the data associated with the receive transfer */
uint32_t total; /**< Holds the total number of data bytes to transfer */
uint32_t remain; /**< Tracks the remaining data bytes to transfer */
uint32_t loaded; /**< Tracks the number of data bytes written to the register */
uint32_t received; /**< Tracks the number of data bytes received during transfer */
} smb_instance_ctrl_t;
And the smb_state_t is a type of enum:
typedef enum e_smb_state
{
SMB_STATE_IDLE =0,
SMB_STATE_START,
SMB_STATE_RECEIVE,
SMB_STATE_TRANSMIT,
SMB_STATE_COMMAND,
SMB_STATE_TXSTOP,
} smb_state_t;
I'm pretty sure that the if statement should give a "true" (smb_status_FLAG was initialized as SMB_STATE_IDLE) and step into it, but during the debbug process I can see that this is not the case...
Could anyone help me to understand why this could happen?
Thank you for any hint!
Regards,
Gregor