|
|
@ -51,21 +51,31 @@ void L3_UARTcom4_exp_protocol(TS_Handle_0d0a *p) |
|
|
|
{ |
|
|
|
if (1 == p->ok ) |
|
|
|
{ |
|
|
|
#if 0 |
|
|
|
U8 array[D_s_SSTR_0D0A_len+1]; |
|
|
|
U8 num = p->buf[0]; |
|
|
|
byte_copy_uc(array,p->buf+1,num); |
|
|
|
p->ok = 0; |
|
|
|
|
|
|
|
array[num] = 0; |
|
|
|
L3_protocol_handler_uart4_fun(array); |
|
|
|
#else |
|
|
|
if(p->buf[0] > D_s_SSTR_0D0A_len) |
|
|
|
{ |
|
|
|
p->buf[0] = D_s_SSTR_0D0A_len; |
|
|
|
} |
|
|
|
p->buf[p->buf[0]] = 0; |
|
|
|
L3_protocol_handler_uart4_fun(p->buf + 1); |
|
|
|
#endif |
|
|
|
p->ok = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void L3_UARTcom3_exp_protocol(TS_Handle_PH3 *p) |
|
|
|
{ |
|
|
|
if (1 == p->ok) |
|
|
|
{ |
|
|
|
#if 1 |
|
|
|
#if 0 |
|
|
|
TS_PH3_ccmodbus ccmodbus; |
|
|
|
byte_copy_uc((U8*)&ccmodbus,(U8*)&p->ts_ccmodbus,p->ts_ccmodbus.num + 3); |
|
|
|
if(ccmodbus.buf[0] != G._rfid) //rfid发生改变
|
|
|
@ -73,7 +83,10 @@ void L3_UARTcom3_exp_protocol(TS_Handle_PH3 *p) |
|
|
|
G.rfid = G._rfid = ccmodbus.buf[0]; |
|
|
|
} |
|
|
|
#else |
|
|
|
L0_uart3_uc(p->reg); |
|
|
|
if(p->ts_ccmodbus.buf[0] != G._rfid) //rfid发生改变
|
|
|
|
{ |
|
|
|
G.rfid = G._rfid = p->ts_ccmodbus.buf[0]; |
|
|
|
} |
|
|
|
#endif |
|
|
|
p->ok = 0; |
|
|
|
} |
|
|
@ -84,48 +97,7 @@ void L3_UARTcom0_exp_protocol(TS_Handle_PH3 *p) |
|
|
|
{ |
|
|
|
if (1 == p->ok) |
|
|
|
{ |
|
|
|
TS_PH3_ccmodbus ccmodbus; |
|
|
|
//L0_uart0_uc(0xaa);
|
|
|
|
byte_copy_uc((U8*)&ccmodbus,(U8*)&p->ts_ccmodbus,p->ts_ccmodbus.num + 3); |
|
|
|
p->ok = 0; |
|
|
|
//L3_protocol_handler_uart0_fun(&ccmodbus,0);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#if 0 |
|
|
|
void L3_UARTcom2_exp_protocol(TS_Handle_PH1A *p) |
|
|
|
{ |
|
|
|
if (1 == p->ok ) |
|
|
|
{ |
|
|
|
U8 slaveId = s_task_485.slaveId; |
|
|
|
TS_PH1A_DAT tsph1A; |
|
|
|
byte_copy_uc((U8*)&tsph1A,(U8*)&p->buf,D_HETU_FXA_buf_max); |
|
|
|
p->ok = 0; |
|
|
|
switch(tsph1A.oper) |
|
|
|
{ |
|
|
|
case OPER_ANGLE_DAT:{ |
|
|
|
s_task_485.received = 1; |
|
|
|
G.currentSensorVal[slaveId - U485_BASE] = (U16)tsph1A.xaxis[0] << 8 | tsph1A.xaxis[1]; |
|
|
|
//ID已�在�议解�处过滤,这里����处�
|
|
|
|
#if 0 |
|
|
|
L0_uart0_uc(tsph1A.filter);L0_uart0_uc(tsph1A.id); |
|
|
|
L0_uart0_uc(tsph1A.xaxis[0]);L0_uart0_uc(tsph1A.xaxis[1]); |
|
|
|
L0_uart0_uc(tsph1A.yaxis[0]);L0_uart0_uc(tsph1A.yaxis[1]); |
|
|
|
L0_uart0_uc(tsph1A.zaxis[0]);L0_uart0_uc(tsph1A.zaxis[1]); |
|
|
|
#endif |
|
|
|
G.papers[slaveId - U485_BASE].version = APP_VERSION_HEX; |
|
|
|
G.papers[slaveId - U485_BASE].LowPower = 0x00; //1bit
|
|
|
|
G.papers[slaveId - U485_BASE].cameraNotWorking = 0x00; //1bit
|
|
|
|
G.papers[slaveId - U485_BASE].cameraIndex = 0x00; //4bit
|
|
|
|
G.papers[slaveId - U485_BASE].paperNum = |
|
|
|
L2_paper_count(slaveId - U485_BASE, (U16)tsph1A.xaxis[0] << 8 | tsph1A.xaxis[1]); //10bit
|
|
|
|
break; |
|
|
|
} |
|
|
|
case OPER_ANGLE_SET_ID: |
|
|
|
L2_do_angle_setid_ack(tsph1A.xaxis[0]); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|