From 00fc23c0b2c7b7dfd6df3e9fb9e385ec949cd8cc Mon Sep 17 00:00:00 2001
From: WXK <287788329@qq.com>
Date: 星期五, 08 九月 2023 11:31:10 +0800
Subject: [PATCH] lora发30次,先提交一下,方便测试

---
 APL/APL.c |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/APL/APL.c b/APL/APL.c
index 4279986..e5e97f1 100644
--- a/APL/APL.c
+++ b/APL/APL.c
@@ -197,22 +197,24 @@
 //        l_bIsVibration = HIDO_TRUE;
         nomove_time=0;
     }
-    if(GPIO_Pin == GPIO_PIN_9)
-    {
-               HAL_ResumeTick();
+//    if(GPIO_Pin == GPIO_PIN_9)//按钮关机
+//    {
+//               HAL_ResumeTick();
 
-            SystemClock_Config();
-            MX_Init();
-            Uart_ReInit(UART_ID_DBG);
-            Uart_ReInit(UART_ID_LORA);
-            Uart_ReInit(UART_ID_GPS);
-        
+//            SystemClock_Config();
+//            MX_Init();
+//            Uart_ReInit(UART_ID_DBG);
+//            Uart_ReInit(UART_ID_LORA);
+//            Uart_ReInit(UART_ID_GPS);
+//        
 
-  
-      PowerDownDetect();
-    }
+//  
+//      PowerDownDetect();
+//    }
     
 }
+extern uint8_t lora_rxbuf[256];
+extern uint8_t lora_rxbufnum;
 extern void Set4LEDColor_Off(void);
 uint8_t lora_sendfinalbag_num;
 void Lora_Sendfinalbag_Poll()
@@ -221,7 +223,9 @@
 if(lp_time-lora_sendfinalbag_time>10&&lora_sendfinalbag_flag)
     {
     lora_sendfinal_rx_bag_flag=1;
-    Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu);  
+    Lora_SendData((HIDO_UINT8 *)GPS_final_data,GPS_final_changdu); //发送数据
+    memset(&lora_rxbuf,0,sizeof(lora_rxbuf));//发一次清一次rx的缓存
+    lora_rxbufnum=0;        
     lora_sendfinalbag_time=lp_time;
     lora_sendfinalbag_num=lora_sendfinalbag_num+1;
         loraled=BLUE;
@@ -229,7 +233,7 @@
         HAL_Delay(100);
         loraled=LEDOFF;
         Set4LEDColor(powerled,loraled,gpsled,uwbled);
-        if(lora_sendfinalbag_num>4)
+        if(lora_sendfinalbag_num>30)
         {
         lora_sendfinal_rx_bag_flag=0;
         lora_sendfinalbag_flag=0;
@@ -346,7 +350,7 @@
     if(((Lora_IsIdle() == HIDO_TRUE)/*为了防止lora初始化的时候进入休眠*/ 
       && (GPS_IsIdle() == HIDO_TRUE)/*防止gps工作时进入休眠*/
       &&(lora_sendfinal_rx_bag_flag==0)//防止lora在2s等待接收的时候进入休眠
-      && (IsTypecCActive() == HIDO_FALSE)) /*5v输入检测时不休眠*/||nomove_flag==1/*静止1小时立刻休眠。*/)
+      && (IsTypecCActive() == HIDO_FALSE)&&(fangchai_flag==0)) /*5v输入检测时不休眠*/||nomove_flag==1/*静止1小时立刻休眠。*/)
     {
 //////    if(Lora_IsIdle() == HIDO_TRUE)
         Power_Sleep();

--
Gitblit v1.9.3