Явное приведение типов, чтобы предупреждений не возникало
This commit is contained in:
parent
1db9b4700c
commit
400caa0aa5
@ -194,7 +194,7 @@ void CANtoRS_Receive(TCANtoRS *p) {
|
||||
if (p->ReadCRCCounter>=2) {
|
||||
p->ReadCRCCounter=0;//ñ÷åò÷èê êîíòðîëüíîé ñóììû
|
||||
MyReadCRC_u16=(p->ReadCRC[0]&0xFF)+((p->ReadCRC[1]<<8)&0xFF00);//çàïàêîâûâàåì äâóõáàéòîâóþ CRC â îäíó ïåðåìåííóþ
|
||||
MyCalcCRC=CANtoRS_C_CRC(p,p->ReadPackData,CANTORS_READ_DATA_MAX_LEN);
|
||||
MyCalcCRC=CANtoRS_C_CRC(p,(Uint16 *)p->ReadPackData,CANTORS_READ_DATA_MAX_LEN);
|
||||
if (MyCalcCRC!=MyReadCRC_u16) {
|
||||
//îøèáêà!
|
||||
p->CounterWrongCRC++;
|
||||
@ -215,7 +215,7 @@ void CANtoRS_Receive(TCANtoRS *p) {
|
||||
};
|
||||
case 3: { //îáðàáîòêà callback
|
||||
p->CounterRes++;
|
||||
p->callback(&co1_vars, &(p->MSG));
|
||||
p->callback(&co1_vars, (TZCanMsg*)&(p->MSG));
|
||||
p->APIpacketMode=0;
|
||||
break;
|
||||
};
|
||||
@ -291,7 +291,7 @@ Uint16 CANtoRS_Write_Real(TZCanMsg* MSG,TCANtoRS *p) {
|
||||
p->TempData[0]|=(MSG->id >> 8) & 7;
|
||||
p->TempData[1]=MSG->id & 0xFF;
|
||||
for (i=0;i<8;i++) p->TempData[i+2]=MSG->data[i];
|
||||
CANtoRS_SendP(p->TempData,10,p);
|
||||
CANtoRS_SendP((Uint16*)p->TempData,10,p);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ void CANtoRS_calc(TCANtoRS *p) {
|
||||
|
||||
//åñëè â áóôåðå åñòü ïàêåò, îæèäàþùèé îòïðàâêè è ïåðåäàò÷èê ñâîáîäåí è íå æäåò heartbeat
|
||||
if (p->PacketInWait) {
|
||||
if (!CANtoRS_Write_Real(&p->bufMSG,p))//îòïðàâèòü íå óäàëîñü?
|
||||
if (!CANtoRS_Write_Real((TZCanMsg*)&p->bufMSG,p))//îòïðàâèòü íå óäàëîñü?
|
||||
p->MessDrop2++;
|
||||
p->PacketInWait=0;//î÷èùàåì áóôåð
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user