1
0
Fork 0

CO_SRDO: static analysis: right operand to == is a composite expression of type 'unsigned16' which is smaller than the left operand of type 'unsigned32' [MISRA 2012 Rule 10.7, required]

This commit is contained in:
temi54c1l8 2024-06-13 14:18:01 +02:00
parent 3c53895fde
commit 3b89378841

View file

@ -498,7 +498,7 @@ CO_SRDO_init(CO_SRDO_t* SRDO, uint8_t SRDO_Index, CO_SRDOGuard_t* SRDOGuard, OD_
}
/* if OD contains default COB_IDs, add node-id */
if ((COB_ID1_normal == defaultCOB_ID) && (COB_ID2_inverted == (defaultCOB_ID + 1U)) && (nodeId <= 64U)) {
if ((COB_ID1_normal == defaultCOB_ID) && (COB_ID2_inverted == (uint32_t)(defaultCOB_ID + 1U)) && (nodeId <= 64U)) {
uint32_t add = (uint32_t)SRDO->nodeId * 2U;
COB_ID1_normal += add;
COB_ID2_inverted += add;