Преглед на файлове

修改配网后不发心跳

wanghechen преди 10 месеца
родител
ревизия
dc5a52769a
променени са 2 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 3 2
      main/ulp_riscv_adc_example_main.c
  2. 4 2
      main/yc_terminal.c

+ 3 - 2
main/ulp_riscv_adc_example_main.c

@@ -440,7 +440,7 @@ static void light_sleep_task(void *args)
 
                     if(Machine_info.wait_send_rssi_bat>(30*60/TIMER_WAKEUP_TIME_S))//30分钟发一次lora
                     {
-                        printf("already send rssi and bat\r\n");
+                        ESP_LOGW(LOG_TAG,"30分钟发送数据"); 
                         Machine_info.wait_send_rssi_bat = 0;
                         f_send_get_chart_data();
                         f_send_lora_rssi(Machine_info.rssi);
@@ -577,8 +577,9 @@ static void light_sleep_task(void *args)
             {
                 iot_button_resume();
             }
-            else if(Machine_info.paired && Machine_info.power_status)
+            if(Machine_info.paired && Machine_info.power_status )
             {
+                vTaskDelay(1000/ portTICK_PERIOD_MS);
                 is_sleep = true;//配对且开机,进入休眠
             }
 

+ 4 - 2
main/yc_terminal.c

@@ -211,10 +211,12 @@ switch (ret) {
 
     memcpy(Machine_info.cid,cid,len);
     
-
+#if 1
     strcpy((char *)Machine_info.cid,result);
-    // strcpy((char *)Machine_info.cid,"1tpmQwHNS");
     printf("device id %s,result = %s,len = %d\r\n",cid,result,len);
+#else
+    strcpy((char *)Machine_info.cid,"1tpmQwHNS");
+#endif
 
     printf("Machine_info cid %s\r\n",Machine_info.cid);
     nvs_close(my_handle);