2016-03-02 04:05 AM
Hello
I am having trouble with the CAN_RX_MSG structure. As the struct contains both StdId and ExtId fields I have seen incorrect data being received in my ISR when both fields are populated.if (CAN_RX_MSG.Ext_Id == 0x11111111) { //gather CAN data }The above statement can evaluate as true when the CAN_RX_MSG structure contains a Std_Id message and its data and leads to the Std_Id data being populated into the program incorrectly.Can anyone advise as to how I can avoid this issue? Is the IDE parameter required?Advice is much appreciated.ThanksDan #can #hal #std_id #ext_id2016-03-04 07:00 AM
Hi,
use the IDE, if (CAN_RX_MSG.IDE == CAN_ID_EXT) { if (CAN_RX_MSG.Ext_Id == 0x11111111) { //gather CAN data } { .... Petr2016-03-14 04:42 AM
Thanks very much Petr!
Dan