fenbao4(uint8_t *wr_buf)
{
uint8_t buf_len = 0;
uint8_t tmp_buf_len = 0;
uint8_t i=0;
uint8_t zhengbao_num = 0;
uint8_t sanbao_num = 0;
/*
while(* (++wr_buf) != '\0')
{
buf_len ++;
}
printf("buf_len:%d\n",buf_len);
*/
while(*wr_buf != '\0')
{
buf_len ++;
wr_buf++;
}
printf("buf_len:%d\n",buf_len);
zhengbao_num = buf_len / MAX_PACKAGE_LEN ;
sanbao_num = buf_len % MAX_PACKAGE_LEN;
wr_buf -= buf_len;
for(i=0; i<zhengbao_num; i++ )
{
uart_tx(wr_buf, MAX_PACKAGE_LEN);
wr_buf += MAX_PACKAGE_LEN;
}
uart_tx(wr_buf, sanbao_num);
}
|