瀏覽代碼

进休眠时间加长

wanghechen 10 月之前
父節點
當前提交
1ee1c4f673
共有 3 個文件被更改,包括 13 次插入6 次删除
  1. 11 4
      main/ulp_riscv_adc_example_main.c
  2. 1 1
      main/user_sleep.h
  3. 1 1
      main/yc_terminal.c

+ 11 - 4
main/ulp_riscv_adc_example_main.c

@@ -438,8 +438,8 @@ static void light_sleep_task(void *args)
                     Machine_info.wait_send_rssi_bat++;
                     printf("唤醒: bat %d wait_send_rssi_bat = %d,\r\n",Machine_info.batt_precent,Machine_info.wait_send_rssi_bat);
 
-                    if(Machine_info.wait_send_rssi_bat>(30*60/TIMER_WAKEUP_TIME_S))//30分钟发一次lora
-                    //if(Machine_info.wait_send_rssi_bat>10)
+                    // if(Machine_info.wait_send_rssi_bat>(30*60/TIMER_WAKEUP_TIME_S))//30分钟发一次lora
+                    if(Machine_info.wait_send_rssi_bat>60)
                     {
                         ESP_LOGW(LOG_TAG,"30分钟发送数据"); 
                         Machine_info.wait_send_rssi_bat = 0;
@@ -579,8 +579,15 @@ static void light_sleep_task(void *args)
             case ESP_SLEEP_WAKEUP_ULP:
              //wakeup_reason = "ulp";
                iot_button_resume();
-                is_sleep = true;//常按会进休眠,然后ulp唤醒,设置is_sleep = true,再次进入休眠
-                printf("ULP SLEEP WAKE UP\r\n");
+               printf("ULP SLEEP WAKE UP\r\n");
+                // is_sleep = true;//常按会进休眠,然后ulp唤醒,设置is_sleep = true,再次进入休眠
+                if(Machine_info.paired && Machine_info.power_status )
+                {
+                    printf("is_sleep = true\r\n");
+                    vTaskDelay(2000/ portTICK_PERIOD_MS);
+                    is_sleep = true;//配对且开机,进入休眠
+                }
+
              break;
             case ESP_SLEEP_WAKEUP_EXT0:
 

+ 1 - 1
main/user_sleep.h

@@ -2,7 +2,7 @@
 #define __USER_SLEEP_H__
 
 
-#define TIMER_WAKEUP_TIME_S      6
+#define TIMER_WAKEUP_TIME_S      30
 #define TIMER_WAKEUP_TIME_US    (TIMER_WAKEUP_TIME_S * 1000 * 1000)     //定义的唤醒的时间  
 #define TIMER_CAN_SEND_TIME     (200)                 //定义可以唤醒lora工作的时间单位ms
 #define LORA_POWER_TIME         (2000)

+ 1 - 1
main/yc_terminal.c

@@ -1165,7 +1165,7 @@ static void screen_task(void* arg)
                 sleep_timer_start(100);  //进入睡眠
             }
 
-            if(Machine_info.power_status == 0)
+            if(Machine_info.power_status == 0 && is_left == false)//展示说明书都是先左后右,等右屏刷完再休眠
             {
                 printf("=>screen deep sleep\r\n");
                 uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);