From 400caa0aa56e762b37d5f7e360a229bab47d6b4a Mon Sep 17 00:00:00 2001 From: Dmitry Shpak Date: Fri, 16 Aug 2019 11:37:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=AF=D0=B2=D0=BD=D0=BE=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D0=BE=D0=B2,=20=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D1=83=D0=BF=D1=80=D0=B5=D0=B6=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B9=20=D0=BD=D0=B5=20=D0=B2=D0=BE=D0=B7=D0=BD?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vsrc/V_CANtoRS.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Vsrc/V_CANtoRS.c b/Vsrc/V_CANtoRS.c index 3a9395c..9ab0ed9 100644 --- a/Vsrc/V_CANtoRS.c +++ b/Vsrc/V_CANtoRS.c @@ -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;//очищаем буфер }