| | |
| | | unsigned char Datas[128]; |
| | | volatile int PacketLength = 0; |
| | | |
| | | stClientInfo ClientInfo[16]; |
| | | |
| | | |
| | | |
| | | unsigned char KBusBCC(void * pData, int nSize) |
| | | { |
| | | unsigned char k; |
| | |
| | | |
| | | #if (BOARD_TYPE == 14) |
| | | BufferIn[ChildId]=p1->data[0]; |
| | | BufferIn[ChildId + 1] = p1->data[1]; |
| | | BufferIn[ChildId + 2 ] = p1->data[2]; |
| | | |
| | | KMem.WXB[ChildId-1]=BufferIn[ChildId]; |
| | | KMem.WXB[ChildId]=BufferIn[ChildId+1]; |
| | | KMem.WXB[ChildId+1]=BufferIn[ChildId+2]; |
| | | |
| | | if (KMRunStat.WorkMode==0) { |
| | | // KMem.WY[0]= KMem.WX[1]+(KMem.WX[2]<<8) ; |
| | | // PutOutput (KMem.WY[0]); |
| | |
| | | break; |
| | | case cmdExChgData: |
| | | BufferIn[0]=p1->data[0]; |
| | | BufferIn[1]=p1->data[1]; |
| | | // KMem.WLYB[1] = BufferIn[1]; |
| | | |
| | | KMem.WYB[1] = BufferIn[1]; |
| | | nSlaveTick=p1->data[4]+(p1->data[5]<<8);//+(p1->data[6]<<16)+(p1->data[7]<<24); |
| | | #if (BOARD_TYPE == 14) |
| | | // PutOutput(BufferIn[0]); |
| | |
| | | // KBusChnStats[0].ClientDatas[7]++; |
| | | // BufferOut[0]=GetInput(); |
| | | BufferOut[0]=GetInput(); |
| | | BufferOut[1]=KMem.WXB[1]; |
| | | #endif |
| | | p1->data[0]=BufferOut[0]; |
| | | p1->data[1]=BufferOut[1]; |
| | | |
| | | p1->data[3]=nIndex; |
| | | p1->data[4]=KBusChnStats[0].ClientDatas[nIndex]; |
| | | p1->data[5]=KBusChnStats[0].ClientDatas[nIndex]>>8; |
| | |
| | | { |
| | | KBusChnStats[nCurPollId].Stat=0; |
| | | KMem.ErrStat=200; |
| | | |
| | | {BufferIn[nCurPollId]=0;} |
| | | #if (BOARD_TYPE == 14) |
| | | BufferIn[nCurPollId]=0; |
| | | KMem.WXB[nCurPollId-1]=BufferIn[nCurPollId]; |
| | | #else |
| | | {BufferIn[nCurPollId]=0; |
| | | KMem.WLX[nCurPollId]=BufferIn[nCurPollId]; |
| | | } |
| | | #endif |
| | | } |
| | | // LL_GPIO_SetOutputPin(GPIOA,LL_GPIO_PIN_7); |
| | | }else |