1
0
Fork 0

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

This commit is contained in:
temi54c1l8 2024-06-27 12:22:43 +02:00
parent 58606174a2
commit d9d9044221

View file

@ -103,7 +103,7 @@ static ODR_t OD_write_1014(OD_stream_t *stream, const void *buf,
/* store values. If default CAN-ID is used, then store only value of
* CO_CAN_ID_EMERGENCY without node id. */
em->producerEnabled = newEnabled;
em->producerCanId = (newCanId == (CO_CAN_ID_EMERGENCY + em->nodeId)) ?
em->producerCanId = (newCanId == ((uint16_t)CO_CAN_ID_EMERGENCY + em->nodeId)) ?
CO_CAN_ID_EMERGENCY : newCanId;
/* configure emergency message CAN transmission */