diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym index e5e9674..1ef7f1e 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym and b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_sym differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc index 9903823..1432d28 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc and b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xc differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf index 1a4af58..cf4aaa7 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf and b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xf differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm index 23f26ee..aba9d11 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm and b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xm differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr index 0202d4f..f2100f0 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr and b/si4/soft_gsm_main.si4project/soft_ps5ws.sip_xr differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.siproj b/si4/soft_gsm_main.si4project/soft_ps5ws.siproj index df46d3c..0e3ee41 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.siproj and b/si4/soft_gsm_main.si4project/soft_ps5ws.siproj differ diff --git a/si4/soft_gsm_main.si4project/soft_ps5ws.siwork b/si4/soft_gsm_main.si4project/soft_ps5ws.siwork index de50550..4ba7fc1 100644 Binary files a/si4/soft_gsm_main.si4project/soft_ps5ws.siwork and b/si4/soft_gsm_main.si4project/soft_ps5ws.siwork differ diff --git a/source/app/app_common.c b/source/app/app_common.c index c25f91f..b072702 100644 --- a/source/app/app_common.c +++ b/source/app/app_common.c @@ -74,6 +74,10 @@ void L2_register_init() G.total_weight = 0; G.pi_weight = 0; G.jing_weight = 0; + G.ch_weight[0] = 0; + G.ch_weight[1] = 0; + G.ch_weight[2] = 0; + G.ch_weight[3] = 0; G.thrombolytic_val = G.bolus_val = G.hold_val = 0; G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0; G.rfidval = G.rfidHospitalNo = 0; @@ -90,7 +94,7 @@ void L2_register_init() G.md_slaver_info[0].slaver = SLAVER_DW20_ID; G.md_slaver_info[0].oper = MODBUS_OPER_READ; G.md_slaver_info[0].reg = 0x02; - G.md_slaver_info[0].regnum = 0x02; + G.md_slaver_info[0].regnum = 0x12; G.md_slaver_info[0].mask = 2; //0->无效 1:暂时有效 2->永久有效 G.md_slaver_info[1].slaver = SLAVER_ASGA03_ID; //倾角XYZ @@ -164,7 +168,7 @@ void L2_register_init() G.ccmd_slaver_info[3].slaver = SLAVER_TCP_SERVER_ID; //服务? G.ccmd_slaver_info[3].oper = MODBUS_OPER_WRITE_M; G.ccmd_slaver_info[3].reg = 0x10; - G.ccmd_slaver_info[3].regnum = 0x0B; + G.ccmd_slaver_info[3].regnum = 0x13; G.ccmd_slaver_info[3].bytes = G.ccmd_slaver_info[3].regnum * 2; G.ccmd_slaver_info[3].buf = (U8*)&G.jing_weight; G.ccmd_slaver_info[3].mask = 0; diff --git a/source/app/app_common.h b/source/app/app_common.h index 5715e0c..14a90b0 100644 --- a/source/app/app_common.h +++ b/source/app/app_common.h @@ -106,6 +106,7 @@ typedef struct printer_paper_calib #define MD_SLAVER_INFO_MAX 6 #define CCMD_SLAVER_INFO_MAX 4 +#define D_ch_max_num 4 //需要持久化的参数,不能超过72字节,否则会导致eeprom溢出 typedef struct global_param_changable @@ -135,7 +136,8 @@ typedef struct printer_maintenance_global U16 hold_val; CCAsGaInfo asga; U8 rfid[6]; - S32 weight[4]; + S32 ch_weight[D_ch_max_num]; + //S32 weight[4]; //U16 reserved2[16 - 9]; MD_SLAVER_INFO md_slaver_info[MD_SLAVER_INFO_MAX]; @@ -153,6 +155,7 @@ typedef struct printer_maintenance_global U16 _key; S32 pi_weight; S32 total_weight; + CCAsGaInfo asga_02; U8 reset; diff --git a/source/app/app_task_485.c b/source/app/app_task_485.c index c235678..b0a99ff 100644 --- a/source/app/app_task_485.c +++ b/source/app/app_task_485.c @@ -71,7 +71,27 @@ void L3_task_485_handle(TS_485 *s) | (S32)(s->pAckPkg->buf[2]) << 16 | (S32)(s->pAckPkg->buf[3]) << 8 | (S32)(s->pAckPkg->buf[4]); - + G.ch_weight[0] = + (S32)(s->pAckPkg->buf[5]) << 24 + | (S32)(s->pAckPkg->buf[6]) << 16 + | (S32)(s->pAckPkg->buf[7]) << 8 + | (S32)(s->pAckPkg->buf[8]); + G.ch_weight[1] = + (S32)(s->pAckPkg->buf[9]) << 24 + | (S32)(s->pAckPkg->buf[10]) << 16 + | (S32)(s->pAckPkg->buf[11]) << 8 + | (S32)(s->pAckPkg->buf[12]); + G.ch_weight[2] = + (S32)(s->pAckPkg->buf[13]) << 24 + | (S32)(s->pAckPkg->buf[14]) << 16 + | (S32)(s->pAckPkg->buf[15]) << 8 + | (S32)(s->pAckPkg->buf[16]); + G.ch_weight[3] = + (S32)(s->pAckPkg->buf[17]) << 24 + | (S32)(s->pAckPkg->buf[18]) << 16 + | (S32)(s->pAckPkg->buf[19]) << 8 + | (S32)(s->pAckPkg->buf[20]); + G.jing_weight = (G.total_weight <= G.pi_weight) ? (0) :(G.total_weight - G.pi_weight) ; break; case 1: diff --git a/source/app/app_task_tcp.c b/source/app/app_task_tcp.c index 5c2d5b7..8b7b855 100644 --- a/source/app/app_task_tcp.c +++ b/source/app/app_task_tcp.c @@ -46,7 +46,7 @@ void L3_task_tcp_handle(TS_tcp *s) TTSS_Task_step(D_task_tcp_send_modbus_pkg) //发送包 L0_uart4_sendArray((U8*)&s->loopPkg, s->pkglen); - //L0_uart0_sendArray((U8*)&s->loopPkg, s->pkglen); + L0_uart0_sendArray((U8*)&s->loopPkg, s->pkglen); s->sendStamp = s_nos_tick.t_1s; if(G.ccmd_slaver_info[s->slaverIndex].mask == 1) { diff --git a/source/app/app_task_tcp_control.c b/source/app/app_task_tcp_control.c index a6252af..dcdd849 100644 --- a/source/app/app_task_tcp_control.c +++ b/source/app/app_task_tcp_control.c @@ -32,12 +32,12 @@ void L3_task_tcp_control_handle(TS_tcp_control *s) //3s一次发送数据包 if(s_nos_tick.t_1s - ts_tcp_control.tcp_send_stmp >= 3) { - if(!G.authed) + if(/*!G.authed*/0) { //发送认证包 G.ccmd_slaver_info[0].mask = 1; } - else if(!G.flowStarted) + else if(/*!G.flowStarted*/0) { //发送流程开始包 G.ccmd_slaver_info[2].mask = 1; diff --git a/source/msp/UART2.h b/source/msp/UART2.h index 965f7f9..a4e2d68 100644 --- a/source/msp/UART2.h +++ b/source/msp/UART2.h @@ -64,7 +64,7 @@ msp/uartx.c 底层代码 和cpu相关 缓存发送也放在里面 #define D_s_uart2_rec_open(); s_uart2_rec.ok = 0;// 关闭串口协议解析 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -#define D_send2_buf_max 64 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms +#define D_send2_buf_max 128 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms /// 19200bps = 20000bps = 2000Bps = 2Byte/ms = 1Byte/0.5ms /// 128Bytes = 128*0.5ms = 64ms struct _s_uart2_send_buf_ diff --git a/source/tpc/tpc_ccmodbus.h b/source/tpc/tpc_ccmodbus.h index 32317b8..b09f9e1 100644 --- a/source/tpc/tpc_ccmodbus.h +++ b/source/tpc/tpc_ccmodbus.h @@ -66,7 +66,7 @@ msp/uartx.c 底层代码 和cpu相关 /// 协议表达的意思为地址为0x52的从机, 功能码16 数据为11 22 33 44,校验码 F5 9F /// 校验码的范围为 -#define D_s_PH3_ccmodbus_max 64 +#define D_s_PH3_ccmodbus_max 128 #define D_s_PH3_ccmodbus_min 4 typedef struct diff --git a/source/tpc/tpc_modbus.h b/source/tpc/tpc_modbus.h index 21c2219..73fb65b 100644 --- a/source/tpc/tpc_modbus.h +++ b/source/tpc/tpc_modbus.h @@ -48,8 +48,8 @@ enum MODBUS_ERR_CODE }; //协议类型: MODBUS RTU模式 -#define D_s_PH4_modbus_max (32) -//#define D_s_PH4_modbus_max (64) +//#define D_s_PH4_modbus_max (32) +#define D_s_PH4_modbus_max (64) typedef struct ts_ph4_modbus {