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