Browse Source

添加按键清0

master
yang 5 years ago
parent
commit
a91f6b5455
  1. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym
  2. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab
  3. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad
  4. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc
  5. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf
  6. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr
  7. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb
  8. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd
  9. BIN
      si4/soft_gsm_main.si4project/soft_gsm_main.siwork
  10. 6
      source/app/app_common.c
  11. 35
      source/app/app_common.h
  12. 18
      source/app/app_task_485.c
  13. 6
      source/app/app_task_485_control.c
  14. 3
      source/app/main.c

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd

Binary file not shown.

BIN
si4/soft_gsm_main.si4project/soft_gsm_main.siwork

Binary file not shown.

6
source/app/app_common.c

@ -20,6 +20,8 @@ void Lu_register_init()
G.p.hold_ratio = 9; //0.1 G.p.hold_ratio = 9; //0.1
G.total_weight = 0; G.total_weight = 0;
G.pi_weight = 0;
G.jing_weight = 0;
G.thrombolytic_val = G.bolus_val = G.hold_val = 0; G.thrombolytic_val = G.bolus_val = G.hold_val = 0;
G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0; G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0;
G.rfid = 0; G.rfid = 0;
@ -50,7 +52,7 @@ void Lu_register_init()
G.md_slaver_info[2].reg = 0x02; G.md_slaver_info[2].reg = 0x02;
G.md_slaver_info[2].regnum = 0x05; G.md_slaver_info[2].regnum = 0x05;
G.md_slaver_info[2].bytes = G.md_slaver_info[2].regnum * 2; G.md_slaver_info[2].bytes = G.md_slaver_info[2].regnum * 2;
G.md_slaver_info[2].buf = (U8*)&G.total_weight; G.md_slaver_info[2].buf = (U8*)&G.jing_weight;
G.md_slaver_info[2].mask = 0; G.md_slaver_info[2].mask = 0;
G.md_slaver_info[3].slaver = SLAVER_SHOW01_ID; //RFID G.md_slaver_info[3].slaver = SLAVER_SHOW01_ID; //RFID
@ -101,7 +103,7 @@ void Lu_register_init()
G.ccmd_slaver_info[3].reg = 0x10; G.ccmd_slaver_info[3].reg = 0x10;
G.ccmd_slaver_info[3].regnum = 0x11; G.ccmd_slaver_info[3].regnum = 0x11;
G.ccmd_slaver_info[3].bytes = G.ccmd_slaver_info[3].regnum * 2; G.ccmd_slaver_info[3].bytes = G.ccmd_slaver_info[3].regnum * 2;
G.ccmd_slaver_info[3].buf = (U8*)&G.total_weight; G.ccmd_slaver_info[3].buf = (U8*)&G.jing_weight;
G.ccmd_slaver_info[3].mask = 0; G.ccmd_slaver_info[3].mask = 0;
G.modbusstmp = 0; G.modbusstmp = 0;

35
source/app/app_common.h

@ -183,11 +183,12 @@ typedef struct cc_asga_info
U16 zaxis; U16 zaxis;
}CCAsGaInfo; }CCAsGaInfo;
#if 1
typedef struct printer_maintenance_global typedef struct printer_maintenance_global
{ {
GlobalNeedPersistParam p; GlobalNeedPersistParam p;
S32 total_weight; S32 jing_weight;
U16 thrombolytic_val; U16 thrombolytic_val;
U16 bolus_val; U16 bolus_val;
U16 hold_val; U16 hold_val;
@ -208,8 +209,40 @@ typedef struct printer_maintenance_global
TS_BoardStatus boardstatus; TS_BoardStatus boardstatus;
U8 _keyled; U8 _keyled;
U8 _rfid; U8 _rfid;
S32 pi_weight;
S32 total_weight;
}PMGlobal; }PMGlobal;
#else
typedef struct printer_maintenance_global
{
GlobalNeedPersistParam p;
S32 jing_weight;
U16 pi_weight;
U16 total_weight;
U16 hold_val;
CCAsGaInfo asga;
U16 rfid;
S32 weight[4];
//U16 reserved2[16 - 9];
MD_SLAVER_INFO md_slaver_info[MD_SLAVER_INFO_MAX];
CCMD_SLAVER_INFO ccmd_slaver_info[CCMD_SLAVER_INFO_MAX];
vU32 modbusstmp;
U16 authed;
U16 flowStarted;
U16 flowStartVal;
U8 ccid[21]; //保存ccid卡号空间 20+'\0'
TS_BoardStatus boardstatus;
U8 _keyled;
U8 _rfid;
U16 thrombolytic_val;
U16 bolus_val;
}PMGlobal;
#endif
//寄存器内存基地址 //寄存器内存基地址
#define REG_MEM_BASE ((U16*)(&G)) //寄存器基础地址(本文件外部不应该使用该宏定义) #define REG_MEM_BASE ((U16*)(&G)) //寄存器基础地址(本文件外部不应该使用该宏定义)

18
source/app/app_task_485.c

@ -70,6 +70,13 @@ void L3_task_485_handle(TS_485 *s)
G.total_weight = G.total_weight =
(S32)(s->pAckPkg->buf[1]) << 24 | (S32)(s->pAckPkg->buf[2]) << 16 | (S32)(s->pAckPkg->buf[3]) << 8 (S32)(s->pAckPkg->buf[1]) << 24 | (S32)(s->pAckPkg->buf[2]) << 16 | (S32)(s->pAckPkg->buf[3]) << 8
| (S32)(s->pAckPkg->buf[4]); | (S32)(s->pAckPkg->buf[4]);
if(G.total_weight <= G.pi_weight){
G.jing_weight = 0;
}else
{
G.jing_weight = G.total_weight - G.pi_weight;
}
} }
else if(s->pAckPkg->salver == G.md_slaver_info[1].slaver) else if(s->pAckPkg->salver == G.md_slaver_info[1].slaver)
{ {
@ -81,7 +88,16 @@ void L3_task_485_handle(TS_485 *s)
{ {
if(s->pAckPkg->buf[2] != G._keyled) //按键发生改变 if(s->pAckPkg->buf[2] != G._keyled) //按键发生改变
{ {
G.rfid = G._keyled = s->pAckPkg->buf[2]; G._keyled = s->pAckPkg->buf[2];
if(G._keyled == 0x28)
{
L0_uart0_uc('#');
G.pi_weight = G.total_weight;
}
else
{
G.rfid = G._keyled;
}
} }
} }
} }

6
source/app/app_task_485_control.c

@ -36,14 +36,14 @@ void L3_task_485_control_handle(TS_485_control *s)
s->rfid_pool = G.rfid; s->rfid_pool = G.rfid;
} }
#else #else
if(s->total_weight_pool != G.total_weight) if(s->total_weight_pool != G.jing_weight)
{ {
G.thrombolytic_val = G.total_weight / 10 * G.p.thrombolytic_ratio / 10; G.thrombolytic_val = G.jing_weight / 10 * G.p.thrombolytic_ratio / 10;
G.bolus_val = G.thrombolytic_val * G.p.bolus_ratio / 10; G.bolus_val = G.thrombolytic_val * G.p.bolus_ratio / 10;
G.hold_val = G.thrombolytic_val * G.p.hold_ratio / 10; G.hold_val = G.thrombolytic_val * G.p.hold_ratio / 10;
G.md_slaver_info[2].mask = 1; G.md_slaver_info[2].mask = 1;
s->total_weight_pool = G.total_weight; s->total_weight_pool = G.jing_weight;
} }
if(s->rfid_pool != G.rfid) if(s->rfid_pool != G.rfid)

3
source/app/main.c

@ -140,7 +140,7 @@ void main(void)
//master->slaver发送逻辑控制 //master->slaver发送逻辑控制
L3_task_485_control_handle(&ts_485_control); L3_task_485_control_handle(&ts_485_control);
#if 1
//gm35维持连接 //gm35维持连接
L3_task_gm35_core_handle(); L3_task_gm35_core_handle();
L3_UARTcom4_exp_protocol(&s_uart4_at_rec); L3_UARTcom4_exp_protocol(&s_uart4_at_rec);
@ -150,6 +150,7 @@ void main(void)
//master->slaver发送逻辑控制 //master->slaver发送逻辑控制
L3_task_tcp_control_handle(&ts_tcp_control); L3_task_tcp_control_handle(&ts_tcp_control);
#endif
} }
}//end main }//end main

Loading…
Cancel
Save