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.

78 lines
2.3 KiB

5 years ago
/*****************************************************************************
update by cc @201501101001
.
uartcom/uartlib.c:
(线),
(lcd等固屏输出的)使
void Lc_print(void (*L0pf_send_uc)(char ww), char *dat,...)
-----------------------------------------------------------------------------------------
uartcom/uartcom0
uart相关的通讯协议 com + n
uart口来对应
typedef struct _ts_lcm_pro_; ? LCM的协议------------
L3_UARTcom0_exp_protocol
-----------------------------------------------------------------------------------------
uartcom/uprotocol: uartcom + n服务的
struct _s_protocol_ ()------struct _s_protocol_
void L1_uart_2buf(struct _s_protocol_ *p)
--------------------------------------------------------------------------------------------
msp/uartx.c cpu相关
L0_UART0_Init
UART0_IRQHandler
L0_Usend_uc----------s_at0
-----------------------------------------------------------------------------------------
********************************************************************************/
#include "tpc_modbus.h"
void L1_s2b_PH4_init(TS_Handle_PH4 *p,U8 slaver)
{
p->max = 0;
p->ok = 0;
p->head = 0;
p->num = 0;
p->slaver = slaver;
p->error = 0;
}
void L1_s2b_PH4(TS_Handle_PH4 *p)
{
if(p->head == 0)
{
if(p->reg == p->slaver)
{
p->head = 1;
p->error = 0;
p->max = D_s_PH4_modbus_max;
p->sp = p->buf;
p->num = 0;
p->sp[p->num++] = p->reg;
}
}
else
{
if(p->num < p->max)
{
p->sp[p->num++] = p->reg;
}
else
{
//P10 ^= 1;
p->error = 1;
}
}
}
/******************************************************************************
** End Of File
******************************************************************************/