平车主控板(运维板)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

65 lines
1.6 KiB

#include "app_task_485_control.h"
#include "../msp/uart0.h"
#include "../app/app_common.h"
TS_485_control ts_485_control;
void L3_task_485_control_init(void)
{
L1_task_init(&ts_485_control.task);
L3_task_s_go(ts_485_control,D_task_init);
ts_485_control.total_weight_pool = 0;
ts_485_control.rfid_pool = 0;
}
#define D_task_485_control_01 0x51
void L3_task_485_control_handle(TS_485_control *s)
{
TTSS_Task_init();
L2_task_go(D_task_485_control_01);
TTSS_Task_step(D_task_485_control_01)
#if 0
if(s_nos_tick.t_1s - s->sendstmp >= 1)
{
s->sendstmp = s_nos_tick.t_1s;
G.thrombolytic_val = G.total_weight / 10 * G.p.thrombolytic_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.md_slaver_info[2].mask = 1;
s->total_weight_pool = G.total_weight;
G.md_slaver_info[3].mask = 1;
s->rfid_pool = G.rfid;
}
#else
if(s->total_weight_pool != G.jing_weight)
{
G.thrombolytic_val = G.jing_weight / 10 * G.p.thrombolytic_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.md_slaver_info[2].mask = 1;
s->total_weight_pool = G.jing_weight;
}
if(G.rfidHospitalNo == D_CAR_HOSPITAL_NO && s->rfid_pool != G.rfidval)
{
G._key = (U16)rfid_key_map_out(G.rfidval);
if(G._key)
{
G.md_slaver_info[3].mask = 1;
}
s->rfid_pool = G.rfidval;
L0_uart0_uc((U8)G._key & 0xFF);
}
#endif
L2_task_go(D_task_485_control_01);
TTSS_Task_end();
}