RFAL st25r3916interrupt.status protection
Hi,
In the RFAL library I see that the global variable st25r3916interrupt.status is protected using platformProtectST25RIrqStatus() while writing to this global variable. While reading st25r3916interrupt.status I see that it is not protected using platformProtectST25RIrqStatus() and do you think this will be okay in a multithreaded environment ? Will not this result in reading half-updated value ? For example: See the below code:
/*******************************************************************************/
uint32_t st25r3916WaitForInterruptsTimed( uint32_t mask, uint16_t tmo )
{
uint32_t tmrDelay;
uint32_t status;
tmrDelay = platformTimerCreate( tmo );
/* Run until specific interrupt has happen or the timer has expired */
do
{
status = (st25r3916interrupt.status & mask);
} while( ( (!platformTimerIsExpired( tmrDelay )) || (tmo == 0U)) && (status == 0U) );
platformTimerDestroy( tmrDelay );
status = st25r3916interrupt.status & mask;
platformProtectST25RIrqStatus();
st25r3916interrupt.status &= ~status;
platformUnprotectST25RIrqStatus();
return status;
}
