平车主控板(运维板)
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.

52 lines
1.2 KiB

5 years ago
#include "app_task_485_control.h"
#include "../msp/uart0.h"
#include "../app/app_common.h"
#define MODBUS_SLAVER_DW20_REG_START 0x02
#define MODBUS_SLAVER_DW20_REG_NUM 0x02
#define MODBUS_SLAVER_RETRY_MAX_TIME 3
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)
//L0_uart0_ulhex(s->total_weight_pool);
//Lc_delay_ms(70);// 2000--7s
//L0_uart0_uc(' ');L0_uart0_uc(' ');L0_uart0_uc(' ');
//Lc_delay_ms(70);// 2000--7s
//L0_uart0_0d0a();
//L0_uart0_ulhex(G.total_weight);
5 years ago
if(s->total_weight_pool != G.total_weight)
{
G.slaver_info[1].mask = 1;
//G.slaver_info[3].mask = 1;
s->total_weight_pool = G.total_weight;
}
if(s->rfid_pool != G.rfid)
{
G.slaver_info[2].mask = 1;
//G.slaver_info[4].mask = 1;
s->rfid_pool = G.rfid;
5 years ago
}
L2_task_go(D_task_485_control_01);
TTSS_Task_end();
}