Hello
Team
In the safety library ,the function
——————————————————————————
"boolean Reg_Read_Compare(ModuleId module, CfgRegRdBk_Mode mode)"
CfgRegDetails details;
Reg_getCfgRegDetails(module,&details);
/* if getCfgRegDetails did not succeed, return FALSE, else proceed */
if((details.getConfiReg==NULL) || (details.baseline==NULL) || (details.current==NULL))
{
return FALSE;
}else{
if(BASELINE == mode)
{
/*SAFETYMCUSW 45 D MR: 21.1 <INSPECTED> "Reason - Checking done above" */
details.getConfiReg(details.baseline, InitialValue);
return TRUE;
}
else if(COMPARE == mode)
{
/* If the module is set for comparison before the initial baselining, it is baselined */
if(!Reg_isBaselined(details.baseline))
{
details.getConfiReg(details.baseline, CurrentValue);
}
/*SAFETYMCUSW 45 D MR: 21.1 <INSPECTED> "Reason - Checking done above" */
memset(details.current,0,sizeof(CfgReg));
details.getConfiReg(details.current,CurrentValue);
/*SAFETYMCUSW 45 D MR: 21.1 <INSPECTED> "Reason - Checking done above" */
if(memcmp(details.baseline,details.current,details.size)==0)
{
return TRUE;
}
else{
return FALSE;
}
}
else
{
/*Rebaseline*/
details.getConfiReg(details.baseline,CurrentValue);
return TRUE;
}
}
———————————————
The code
if(!Reg_isBaselined(details.baseline))
{
details.getConfiReg(details.baseline, CurrentValue);
}
1.Does it always enter this condition?
2.CfgRegDetails details; details is a variable in a function.so It will be automatically cleared every time when the is executed.
why the” memcmp(details.baseline,details.current,details.size)"Is this data correct?
thank you