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.

32 lines
665 B

4 years ago
#include "app_task_uart0.h"
#include "../msp/uart0.h"
#include "../app/common.h"
void L3_task_uart0_modbus_handler(TP_Handler_X *ph4)
{
#if 1
if(ph4->ok)
{
TS_PH4_modbus *ts_modbus = (TS_PH4_modbus *)ph4->buf;
if(ts_modbus->slaver == R.p.slaver_id || ts_modbus->slaver == D_UART0_485_SLAVER_ID_BROADCAST) //从机
{
U16 acklen = L3_modbus_slaver_ack(ts_modbus,&s_uart0_ack);
L0_uart0_sendArray((U8*)&s_uart0_ack, acklen);
switch(ts_modbus->oper)
{
case 0x06:
case 0x10:
//重新计算重量
R.total_weight = L3_count_std_weight(G._total_weight);
//持久化
L3_eeprom_persist_param();
break;
}
}
}
#endif
}