From 71f8bdb7c63acc381d71105bb950411029f4250f Mon Sep 17 00:00:00 2001
From: jinlicong <493886250@qq.com>
Date: Mon, 03 Jun 2024 20:00:58 +0800
Subject: [PATCH] 测试远传
---
Function/WirelessRemoteComm/wireless_remote_comm.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Function/WirelessRemoteComm/wireless_remote_comm.c b/Function/WirelessRemoteComm/wireless_remote_comm.c
index b6e57bd..469d054 100644
--- a/Function/WirelessRemoteComm/wireless_remote_comm.c
+++ b/Function/WirelessRemoteComm/wireless_remote_comm.c
@@ -15,6 +15,9 @@
{
OutputIO(WRC_PWR_PORT,WRC_PWR_PIN,OUT_PUSHPULL);
OutputIO(PWR_3V8_O_PORT,PWR_3V8_O_PIN,OUT_PUSHPULL);
+ CloseIO(PWR_3V8_EN_PORT,PWR_3V8_EN_PIN);
+ PWR_3V8_OFF;
+ WRC_PWR_OFF;
}
@@ -120,6 +123,9 @@
check_sum += *(buf_p + count_i);
if(*(buf_p + 89) == check_sum){
+
+ WRC_RX_DMA_CH3_reload(); //����У��ͨ��������Ϊ������Ҫ���յ������Ѿ���ɣ���Ҫ����DMA����,
+
if(*(buf_p + 2) == 1){
return_flag = LINK_OK;
if((*(buf_p+3) != 1)&&(*(buf_p+3) <0x39)){
@@ -157,7 +163,7 @@
if(buf_p != NULL){
buf_next_p = strstr(buf_p , ",");
if(buf_next_p != NULL){
- __SYS_DELAY_SEC_TIME_SET_(wrc_timeout_para,wrc_ctrl_para_g.time_out_time_sec);//��ʱ���ڽ��յ�+R�ͳ�ֵ��ʱʱ�䣬�������Ӧ�÷���Э��֡��ʽ�жϳɹ�����Ӧ����֮��
+
return SizhuV4ProtocolDataAnalysis((uint8_t *)buf_next_p,ack_buf,ack_buf_length);
}
@@ -181,7 +187,7 @@
//?��Ҫ��ͨѶ������ʼ�����Է�������
SizhuV4SendParaInit();
- return WRC_SEND_DATA;
+ return WRC_CREATE_LINK;
}
WRC_STATUS WrcCreateLinkPro(void)
@@ -210,7 +216,7 @@
// wrc_ctrl_para_g.time_out_cnt = wrc_ctrl_para_g.time_out_time_sec;
send_buf[0] = WRC_MODULE_CMD_DATA_UP;
- send_buf[1] = send_length &0x0f;
+ send_buf[1] = send_length &0xff;
send_buf[2] = send_length >>8;
if(send_length > sizeof(send_buf)){
@@ -219,7 +225,7 @@
return WRC_OFF;
}
- WRC_UART_SEND(send_buf,send_length);
+ WRC_UART_SEND(send_buf,send_length + 3);
__SYS_DELAY_SEC_TIME_SET_(wrc_timeout_para,wrc_ctrl_para_g.time_out_time_sec);
@@ -249,9 +255,9 @@
if((send_length > 0)&&(send_length < sizeof(send_buf))){ //����Ӧ������Ҫ����
send_buf[0] = WRC_MODULE_CMD_DATA_UP;
- send_buf[1] = send_length &0x0f;
+ send_buf[1] = send_length &0xff;
send_buf[2] = send_length >>8;
- WRC_UART_SEND(send_buf,send_length);
+ WRC_UART_SEND(send_buf,send_length + 3);
__SYS_DELAY_SEC_TIME_SET_(wrc_timeout_para,wrc_ctrl_para_g.time_out_time_sec);
}
memset(wrc_uart_para_g.recv_buf,0,sizeof(wrc_uart_para_g.recv_buf));
@@ -298,7 +304,7 @@
PWR_3V8_OFF;
return WRC_OFF;
- }else if(wrc_ctrl_para_g.wrc_OFF_cnt == 8){
+ }else if(wrc_ctrl_para_g.wrc_OFF_cnt >= 8){
//�ӳ��˳�ͨѶ���̣���ʱ��Դ�Ѿ��رգ��൱�ڸ�����һ��ʱ����
WRC_PWR_OFF;
PWR_3V8_OFF;
@@ -317,7 +323,7 @@
return WRC_IDLE; //�ػ���ϣ�����WRC_IDLE��������ͨѶ����
}
- return WRC_IDLE;
+ return WRC_OFF;
}
--
Gitblit v1.9.3