Procházet zdrojové kódy

将刷屏集中起来

wanghechen před 8 měsíci
rodič
revize
9ad7826b1f

+ 52 - 0
components/LORA/LORA.c

@@ -656,6 +656,58 @@ uint8_t set_lora(uint8_t new_channel,uint8_t eflag)
     gpio_set_level(LORA_SET_PIN, 1);
     return ret;
 }
+
+
+
+void list_lora(void)
+{
+  printf("%s\r\n",__FUNCTION__);
+#if 1
+   uint8_t lorabuf[4];
+   lorabuf[0]=0x03;
+   lorabuf[1]=0x24;
+   lorabuf[2]=1;
+   lorabuf[3]=crc8(lorabuf,3,0x55,0x07);
+
+  lora_sendData(lorabuf,sizeof(lorabuf));
+ #endif
+}
+
+
+void print_lora(void)
+{
+   printf("%s\r\n",__FUNCTION__);
+  int user_size = 0;
+  uint8_t  data[50] = {0};
+  lora.lora_mode = Lora_Cmd_Mode;
+  gpio_set_level(LORA_SET_PIN, 0);
+  
+          lora_set_config_mode(0x01);
+          vTaskDelay(100/ portTICK_PERIOD_MS);
+           user_size = y_ringbuf_get_used_size(lora_ringbuf);
+          y_ringbuf_read_clear(lora_ringbuf, data, user_size);
+
+  list_lora();
+  vTaskDelay(100/ portTICK_PERIOD_MS);
+  user_size = y_ringbuf_get_used_size(lora_ringbuf);
+
+  y_ringbuf_read_clear(lora_ringbuf, data, user_size);
+  // if(user_size!=0)
+  {
+      printf("list_lora len = %d\r\n",user_size);
+      for(int i = 0;i<user_size;i++)
+        printf("%02x",data[i]);
+      printf("\n\n");
+  }
+
+          lora_set_config_mode(0x00);
+          vTaskDelay(100/ portTICK_PERIOD_MS);
+          user_size = y_ringbuf_get_used_size(lora_ringbuf);
+          y_ringbuf_read_clear(lora_ringbuf, data, user_size);
+
+  lora.lora_mode =  Lora_UART_Mode;
+  gpio_set_level(LORA_SET_PIN, 1);
+}
 void reset_lora(uint8_t new_channel)
 {
 

+ 1 - 1
components/LORA/include/LORA.h

@@ -277,7 +277,7 @@ bool lora_set_net_id(String id);
 bool lora_set_rssi(int rssi);
 #endif
 
-
+void print_lora(void);
 
 
 

+ 47 - 16
main/ulp_riscv_adc_example_main.c

@@ -57,7 +57,7 @@
 
 static const char *LOG_TAG = "ulp_riscv_adc";
 extern  uint8_t _wakeup_reson;  //内存上次唤醒的原因
-
+extern QueueHandle_t screen_queue;
 bool is_first_run = false;      //当前时间片只执行一次标志
 
 
@@ -439,6 +439,7 @@ static void light_sleep_task(void *args)
                     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)
                     {
                         ESP_LOGW(LOG_TAG,"30分钟发送数据"); 
                         Machine_info.wait_send_rssi_bat = 0;
@@ -475,7 +476,7 @@ static void light_sleep_task(void *args)
                 
                 break;
             case ESP_SLEEP_WAKEUP_GPIO:
-            
+            bool is_left = false;
             printf("ULP ESP_SLEEP_WAKEUP_GPIO  WAKE UP\r\n");
 
              lev_2 = gpio_get_level(2);
@@ -496,8 +497,13 @@ static void light_sleep_task(void *args)
 
                                 gpio_hold_dis(PIN_R_CS);
 
-                                extern void dis_right_instructions();
-                                dis_right_instructions();
+                            is_left = false;
+                            if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            {
+                                ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            } 
+                                // extern void dis_right_instructions();
+                                // dis_right_instructions();
                                 //dis_instructions();
                                 //right_screen_send();
                                 printf("charge in\r\n");
@@ -512,8 +518,13 @@ static void light_sleep_task(void *args)
 
                                 //right_screen_send();
                                 gpio_hold_dis(PIN_R_CS);
-                                extern void dis_right_instructions();
-                                dis_right_instructions();
+                                // extern void dis_right_instructions();
+                                // dis_right_instructions();
+                            is_left = false;
+                            if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            {
+                                ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            } 
                                 sleep_timer_start(1000);
 
 
@@ -579,7 +590,7 @@ static void light_sleep_task(void *args)
             }
             if(Machine_info.paired && Machine_info.power_status )
             {
-                vTaskDelay(1000/ portTICK_PERIOD_MS);
+                vTaskDelay(2000/ portTICK_PERIOD_MS);
                 is_sleep = true;//配对且开机,进入休眠
             }
 
@@ -588,11 +599,11 @@ static void light_sleep_task(void *args)
             default:
 
 
-                //printf("other = %d\r\n",reson);
+            //printf("other = %d\r\n",reson);
 
-                //esp_light_sleep_start();
-                //wakeup_reason = "other";
-                break;
+            //esp_light_sleep_start();
+            //wakeup_reason = "other";
+            break;
         }
         //free(wakeup_reason);
        /* extern bool is_adv;
@@ -610,7 +621,17 @@ static void light_sleep_task(void *args)
             {
                 printf("-->low batt , power off\r\n");
                 Machine_info.power_status = 0;
-                dis_instructions();  //进入关机界面
+                // dis_instructions();  //进入关机界面
+                bool is_left = true;
+                if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                {
+                    ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                } 
+                is_left = false;
+                if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                {
+                    ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                } 
                 sleep_timer_start(1000);
             }
 
@@ -634,8 +655,13 @@ static void light_sleep_task(void *args)
 
 
                                 gpio_hold_dis(PIN_R_CS);
-                                extern void dis_right_instructions();
-                                dis_right_instructions();
+                            is_left = false
+                            if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            {
+                                ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            } 
+                                // extern void dis_right_instructions();
+                                // dis_right_instructions();
                                 printf("charge in\r\n");
                             }
 
@@ -647,8 +673,13 @@ static void light_sleep_task(void *args)
                                 is_first_charge = false;
 
                                 gpio_hold_dis(PIN_R_CS);
-                                extern void dis_right_instructions();
-                                dis_right_instructions();
+                                // extern void dis_right_instructions();
+                                // dis_right_instructions();
+                            is_left = false
+                            if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            {
+                                ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            } 
 
                                 sleep_timer_start(1000);
                                 //right_screen_send();

+ 3 - 16
main/user_config.h

@@ -102,22 +102,9 @@ typedef enum
 
 extern int last_batt_precent;
 
-// void yc_timer_restart(void);
-void Paint_leftScreen_main(Machine_info_t* info);
-void Paint_rightScreen_main(Machine_info_t* info);
-
-
-void Paint_leftScreen_main_quick(Machine_info_t* info);
-void Paint_leftScreen_main_slow(Machine_info_t* info);
-
-
-void Paint_leftScreen_main_powerOn(void);
-void Paint_rightScreen_main_powerON(void);
-void Paint_rightScreen_main_quick(Machine_info_t* info);
-
-void Paint_rightScreen_main_slow(Machine_info_t* info);
-void dis_instructions();
-
 void esp_ble_ota(void);
 void reset_default(bool is_dis,uint8_t power_status);
+
+void Paint_leftScreen(bool is_poweron,bool is_paired,bool is_quick,bool is_test);
+void Paint_rightScreen(bool is_poweron,bool is_paired,bool is_quick,bool is_test);
 #endif

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1026 - 2274
main/yc_paint.c


+ 45 - 12
main/yc_protocol.c

@@ -106,8 +106,21 @@ void reset_default(bool is_dis,uint8_t power_status)
     {
         return;
     }
-    Paint_leftScreen_main_quick(&Machine_info);
-    Paint_rightScreen_main_quick(&Machine_info);
+    // Paint_leftScreen_main_quick(&Machine_info);
+    // Paint_rightScreen_main_quick(&Machine_info);
+    bool is_left = true;
+    //重置快刷
+    Machine_info.left_current_Quick_refresh_time = 0;
+    Machine_info.right_current_Quick_refresh_time = 0;
+    if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+    {
+        ESP_LOGE(LOG_TAG,"queue:screen_queue");
+    } 
+    is_left = false;
+    if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+    {
+        ESP_LOGE(LOG_TAG,"queue:screen_queue");
+    } 
 }
 
 
@@ -1701,8 +1714,21 @@ void business_logic_func(const LORA_DATA_T* buf,uint8_t cmd_index,int msg)
     case PROTOCOL_HARDWARE_GWPAIRED:  //配网 暂时单独发送ack 
     reset_default(false,1);
     hardware_gwpair_func(buf);
-    Paint_leftScreen_main_quick(&Machine_info);
-    Paint_rightScreen_main_quick(&Machine_info);
+    // Paint_leftScreen_main_quick(&Machine_info);
+    // Paint_rightScreen_main_quick(&Machine_info);
+    bool is_left = true;
+    //重置快刷
+    Machine_info.left_current_Quick_refresh_time = 0;
+    Machine_info.right_current_Quick_refresh_time = 0;
+    if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+    {
+        ESP_LOGE(LOG_TAG,"queue:screen_queue");
+    } 
+    is_left = false;
+    if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+    {
+        ESP_LOGE(LOG_TAG,"queue:screen_queue");
+    } 
     break;
 
     case PROTOCOL_HARDWARE_UNGWPAIRED: //取消配网
@@ -2130,7 +2156,7 @@ bool subcontract(YC_DATA_T* data)
                     {
                         reply_ack_func(0x00,rsp_msgid,true,NULL);  //回复ack
                         spiffs_write(&Machine_info);
-                        ESP_LOGE(LOG_TAG,"cmd = %02X  msg = %X start reply ack\r\n",0x00,rsp_msgid);
+                        ESP_LOGE(LOG_TAG,"1times  cmd = %02X  msg = %X start reply ack\r\n",0x00,rsp_msgid);
                     }
             }
         
@@ -3820,36 +3846,36 @@ void user_compare_power_off(int last,int now)//这个函数用来比较关机状
         // ESP_LOGW(LOG_TAG,"last[%d]-now[%d]",last,now);
         return;
     }
-    // printf("user_compare_power_off last[%d] now[%d] \n",last,now);
-    extern void dis_right_instructions();
+    bool is_left = false;
+    bool is_dis = false;
     switch (last)
     {
         case 100:
             if(now != 100)
             {
                     gpio_hold_dis(PIN_R_CS);
-                    dis_right_instructions();
+                    is_dis = true;
             }
         break;
         case 75 ... 99:
             if((now == 100) || (now<75))
             {
                 gpio_hold_dis(PIN_R_CS);
-                dis_right_instructions();
+                is_dis = true;
             }
         break;
         case 50 ... 74:
             if((now > 74) || (now<50))
             {
                 gpio_hold_dis(PIN_R_CS);
-                dis_right_instructions();
+                is_dis = true;
             }
         break;
         case 25 ... 49:
             if((now >49) || (now<25))
             {
                 gpio_hold_dis(PIN_R_CS);
-                dis_right_instructions();
+                is_dis = true;
 
             }
         break;
@@ -3857,13 +3883,20 @@ void user_compare_power_off(int last,int now)//这个函数用来比较关机状
             if((now == 0) || (now>24))
             {
                 gpio_hold_dis(PIN_R_CS);
-                dis_right_instructions();
+                is_dis = true;
             }
         break;
         default:
         ESP_LOGE(LOG_TAG,"err:not 0~100");
         break;
     }
+    if(is_dis)
+    {
+        if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+        {
+            ESP_LOGE(LOG_TAG,"queue:screen_queue");
+        } 
+    }
 }
 
 

+ 90 - 263
main/yc_terminal.c

@@ -68,7 +68,7 @@ QueueHandle_t Send_Data_queue;  //发送链表任务
 
 SemaphoreHandle_t button_semaphore;        //刷新屏幕时都得加上按键互斥锁
 
-SemaphoreHandle_t screen_semaphore;  //刷新屏幕时都得加上互斥锁
+// SemaphoreHandle_t screen_semaphore;  //刷新屏幕时都得加上互斥锁
 
 
 
@@ -358,7 +358,7 @@ void app_init()
 //charge_init();
 //decection_charging_init();
 
-    screen_queue   =   xQueueCreate(10, sizeof(bool));
+    screen_queue   =   xQueueCreate(25, sizeof(bool));
 
 
     lora_data_queue     =   xQueueCreate(20, sizeof(LORA_DATA_T));
@@ -367,7 +367,7 @@ void app_init()
 
     button_Data_queue   =   xQueueCreate(10, sizeof(uint8_t));
 
-    screen_semaphore    =   xSemaphoreCreateMutex();
+    // screen_semaphore    =   xSemaphoreCreateMutex();
     screen_event = xEventGroupCreate();
 // button_semaphore    =   xSemaphoreCreateMutex();
 
@@ -465,9 +465,13 @@ if(last_paint_buf_right!=NULL)
     {
 
         adc1_init();
-        extern void dis_right_instructions();
-        dis_right_instructions();
-        
+        // extern void dis_right_instructions();
+        // dis_right_instructions();
+    bool is_left = false;
+    if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+    {
+        ESP_LOGE(LOG_TAG,"queue:screen_queue");
+    } 
         int power_key  = 0; 
         int charge_key = 0; 
 
@@ -485,7 +489,7 @@ if(last_paint_buf_right!=NULL)
             Machine_info.batt_precent =  read_battery_voltage();
 
             Machine_info.last_batt_precent = Machine_info.batt_precent;  
-
+        is_left = false;
         while(1)
         {
             //value++;
@@ -514,9 +518,13 @@ if(last_paint_buf_right!=NULL)
             {
                 printf("charge_key is %s\r\n",!charge_key?"charge in":"charge out");
 
-                extern void dis_right_instructions();
-                dis_right_instructions();
-
+                // extern void dis_right_instructions();
+                // dis_right_instructions();
+                is_left = false;
+                if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                {
+                    ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                } 
 
 
 
@@ -1101,16 +1109,22 @@ static void screen_task(void* arg)
     ESP_LOGW(LOG_TAG,"screen_task  %d",reson);
     if ((reson != ESP_SLEEP_WAKEUP_ULP) && (reson != ESP_SLEEP_WAKEUP_TIMER)&&(reson != ESP_SLEEP_WAKEUP_EXT0)) 
     {
-        Paint_leftScreen_main_powerOn();
-        Paint_rightScreen_main_powerON();
+        // Paint_leftScreen_main_powerOn();
+        // Paint_rightScreen_main_powerON();
+        Paint_leftScreen(Machine_info.power_status,Machine_info.paired,false,false);
+        Paint_rightScreen(Machine_info.power_status,Machine_info.paired,false,false);
     }
     else if(reson == ESP_SLEEP_WAKEUP_EXT0)
     {
-        //开机刷新左屏慕
-         Paint_leftScreen_main_slow(&Machine_info);
-         Paint_rightScreen_main_slow(&Machine_info);
+        //按键从深睡唤醒,开机刷新屏慕
+        ESP_LOGW(LOG_TAG,"按键从深睡唤醒,开机刷新屏慕");
+        //  Paint_leftScreen_main_slow(&Machine_info);
+        //  Paint_rightScreen_main_slow(&Machine_info);
+        Paint_leftScreen(Machine_info.power_status,Machine_info.paired,false,false);
+        Paint_rightScreen(Machine_info.power_status,Machine_info.paired,false,false);
     }
     bool is_left = false;
+    Machine_info.left_current_Quick_refresh_time = 1;//开机慢刷
     while(1)
     {
         if(xQueueReceive(screen_queue, &is_left,(TickType_t)portMAX_DELAY))
@@ -1122,17 +1136,27 @@ static void screen_task(void* arg)
                 if(Machine_info.left_current_Quick_refresh_time >=  Machine_info.left_max_Quick_refresh_time)
                 {
                     Machine_info.left_current_Quick_refresh_time = 0;
-                    Paint_leftScreen_main_slow(&Machine_info);
+                    // Paint_leftScreen_main_slow(&Machine_info);
+                    Paint_leftScreen(Machine_info.power_status,Machine_info.paired,false,false);
                 }
                 else
                 {
                     Machine_info.left_current_Quick_refresh_time++;
-                    Paint_leftScreen_main_quick(&Machine_info);
+                    // Paint_leftScreen_main_quick(&Machine_info);
+                    Paint_leftScreen(Machine_info.power_status,Machine_info.paired,true,false);
                 }
             }
             else//刷右屏
             {
-                Paint_rightScreen_main_slow(&Machine_info);
+                if(Machine_info.right_current_Quick_refresh_time ==  0)
+                {
+                    Machine_info.left_current_Quick_refresh_time = 1;
+                    Paint_rightScreen(Machine_info.power_status,Machine_info.paired,true,false);
+                }
+                else
+                {
+                    Paint_rightScreen(Machine_info.power_status,Machine_info.paired,false,false);
+                }
             }
 
             if((Machine_info.power_status == 1)&&(Machine_info.paired == 1))
@@ -1192,6 +1216,7 @@ static void button_task(void* arg)
 #endif
             if(button_info < 0x12)  //左屏慕按键
             {
+                // print_lora();//按键查询lora配置 
                 if(Machine_info.btn_dis_flag[button_info-1] == false)
                 {
                     printf("按键关闭,默认运行\n");
@@ -1347,9 +1372,20 @@ static void button_task(void* arg)
                         if(Machine_info.power_status == 1)  //开机状态
                         {
                             Machine_info.power_status = 0;
-                            dis_instructions();
-                            vTaskDelay(1000 / portTICK_PERIOD_MS);
-                            sleep_timer_start(100); //开始进入倒计时休眠 
+                            // dis_instructions();
+
+                            // bool is_left = true;
+                            // if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            // {
+                            //     ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            // } 
+                            // is_left = false;
+                            // if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            // {
+                            //     ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            // } 
+                            // vTaskDelay(1000 / portTICK_PERIOD_MS);
+                            // sleep_timer_start(100); //开始进入倒计时休眠 
     
                             printf("last power on current power off ready sleep\r\n");
                             // sleep_timer_start(100); //开始进入倒计时休眠 //更改为刷完两个屏幕,倒计时
@@ -1373,16 +1409,42 @@ static void button_task(void* arg)
                             uart_sleep_out_config();
                             
 
-                            Paint_leftScreen_main_slow(&Machine_info);
-                            Paint_rightScreen_main_slow(&Machine_info);
+                            // Paint_leftScreen_main_slow(&Machine_info);
+                            // Paint_rightScreen_main_slow(&Machine_info);
                             // Paint_leftScreen_main_quick(&Machine_info);
                             // Paint_rightScreen_main_quick(&Machine_info);
+                                                        // dis_instructions();
+                            // bool is_left = true;
+                            // if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            // {
+                            //     ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            // } 
+                            // is_left = false;
+                            // if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                            // {
+                            //     ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                            // } 
+
+                            // if( (Machine_info.power_status == 1) &&  (Machine_info.paired == 1))
+                            // {
+                            //     //判断当前开机 是否配对 继续执行时间片操作
+                            //     sleep_timer_start(100); //开始进入倒计时休眠 
+                            // }
+                        }
 
-                            if( (Machine_info.power_status == 1) &&  (Machine_info.paired == 1))
-                            {
-                                //判断当前开机 是否配对 继续执行时间片操作
-                                sleep_timer_start(100); //开始进入倒计时休眠 
-                            }
+                        is_left = true;
+                        if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                        {
+                            ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                        } 
+                        is_left = false;
+                        if(xQueueSend(screen_queue,&is_left,portMAX_DELAY) != true)
+                        {
+                            ESP_LOGE(LOG_TAG,"queue:screen_queue");
+                        } 
+                        if(Machine_info.paired || !Machine_info.power_status)
+                        {
+                            sleep_timer_start(100); //开始进入倒计时休眠 
                         }
 
                 }
@@ -1788,238 +1850,3 @@ void read_deal_data_callback_handler()
 
   #endif
 }
-
-
-
-// #define MY_DISP_HOR_RES    648
-// #define MY_DISP_VER_RES    480
-// #define DISP_BUF_SIZE (480 * 648)
-
-
-// volatile bool disp_flush_enabled = true;
-
-// /* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
-//  */
-// void disp_enable_update(void)
-// {
-//     disp_flush_enabled = true;
-// }
-
-// /* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
-//  */
-// void disp_disable_update(void)
-// {
-//     disp_flush_enabled = false;
-// }
-
-// /*Flush the content of the internal buffer the specific area on the display.
-//  *`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display.
-//  *You can use DMA or any hardware acceleration to do this operation in the background but
-//  *'lv_display_flush_ready()' has to be called when it's finished.*/
-
-
-// void disp_driver_flush(lv_disp_drv_t * drv, const lv_area_t * area, lv_color_t * color_map)
-// // static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
-// {
-//     //printf("-------------------disp_flush \r\n");
-//     if(disp_flush_enabled) {
-//         /*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
-//         int32_t x;
-//         int32_t y;
-//         printf("%d,%d,%d,%d\r\n",area->x1, area->y1, area->x2, area->y2);
-//         epd_partial_cache1(  area->x1, area->y1, area->x2, area->y2,SCREEN_LEFT,color_map);
-//         epd_powerOn_refresh(SCREEN_LEFT);
-//     #if 0
-//         for(y = area->y1; y <= area->y2; y++) {
-//             for(x = area->x1; x <= area->x2; x++) {
-//                 printf("%ld,%ld\r\n",x,y);
-//                 /*Put a pixel to the display. For example:*/
-//                 /*put_px(x, y, *px_map)*/
-//                 px_map++;
-//             }
-//         }
-//      #endif   
-//     }
-
-
-//     /*IMPORTANT!!!
-//      *Inform the graphics library that you are ready with the flushing*/
-//     #if 0
-//     lv_display_flush_ready(disp_drv);
-//     #else
- 
-//     lv_disp_flush_ready(drv);
-//     #endif
-// }
-
-// #if 0
-// static uint8_t *buf_3_1;
-// static uint8_t *buf_3_2;
-// #else
-// static uint8_t *buf;
-// #endif
-
-
-// static void gui_task(void* pvParameter)
-// {
-
-
-
-//     #if 0
-//     lv_init();
-
-//     //buf= heap_caps_malloc(DISP_BUF_SIZE * sizeof(lv_color_t), MALLOC_CAP_DMA|MALLOC_CAP_SPIRAM);
-//     //assert(buf != NULL);
-
-
-
-//     /*------------------------------------
-//      * Create a display and set a flush_cb
-//      * -----------------------------------*/
-//     lv_display_t * disp = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
-//     lv_display_set_flush_cb(disp, disp_flush);
-
-
-
-//     /* Example 3
-//      * Two buffers screen sized buffer for double buffering.
-//      * Both LV_DISPLAY_RENDER_MODE_DIRECT and LV_DISPLAY_RENDER_MODE_FULL works, see their comments*/
- 
-//     buf_3_1= heap_caps_malloc(MY_DISP_HOR_RES *MY_DISP_VER_RES, MALLOC_CAP_8BIT);
-//     buf_3_2= heap_caps_malloc(MY_DISP_HOR_RES *MY_DISP_VER_RES, MALLOC_CAP_8BIT);
-
-//     if(buf_3_1 ==NULL)
-//     {
-//     printf("-------------------buf_3_1 \r\n");
-
-//     }
-
-//     if(buf_3_2 ==NULL)
-//     {
-//     printf("-------------------buf_3_2 \r\n");
-
-//     }
-
-
-
-//     lv_display_set_draw_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1)*MY_DISP_HOR_RES *MY_DISP_VER_RES, LV_DISPLAY_RENDER_MODE_DIRECT);
-
-
-
-
-// lv_theme_t * th = lv_theme_mono_init(disp, true, &lv_font_montserrat_14);
-
-// bool is = lv_theme_mono_is_inited();
-
-// if(is)printf("========================ok=================\r\n");
-// else printf("========================fail=================\r\n");
-
-
-//    lv_disp_set_theme(disp, th); /*Assign the theme to the display*/
-
-//     /*Create a white label, set its text and align it to the center*/
-//     lv_obj_t * label = lv_label_create(lv_scr_act());
-//     lv_label_set_text(label, "Hello world");
-//     lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);
-//     lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
-
-
-
-
-// #else
-
-//    lv_init();
-//     //disp_driver_init();
-//     static lv_disp_draw_buf_t disp_buf;
-
-//     uint32_t size_in_px = DISP_BUF_SIZE;
-
-//     buf= heap_caps_malloc(MY_DISP_HOR_RES *MY_DISP_VER_RES, MALLOC_CAP_8BIT);
-
-
-//     lv_disp_draw_buf_init(&disp_buf, buf, NULL, size_in_px);
-
-//     lv_disp_drv_t disp_drv;
-//     lv_disp_drv_init(&disp_drv);
-
-//     disp_drv.flush_cb = disp_driver_flush;
-//     disp_drv.hor_res = 648;
-//     disp_drv.ver_res = 480;
-//     disp_drv.full_refresh = 1;
-//     disp_drv.draw_buf = &disp_buf;
-
-//     lv_disp_t * disp = lv_disp_drv_register(&disp_drv);
-
-
-// lv_disp_rot_t dir = lv_disp_get_rotation(disp);
-// lv_disp_set_rotation(disp, LV_DISP_ROT_180);
-
-// printf("dir=%d\r\n",dir);
-
-
-
-//    /*Create a white label, set its text and align it to the center*/
-//     lv_obj_t * label = lv_label_create(lv_scr_act());
-//     lv_label_set_text(label, "Hello world");
-
-//     lv_obj_set_style_bg_color(lv_scr_act(), lv_color_make(0,0,0), 0);//设置背景颜色为白色
-
-//     lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);
-//     lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
-
-
-
-
-//     lv_obj_t * label1 = lv_label_create(lv_scr_act());
-//     lv_label_set_text(label1, "world");
-//     //lv_obj_set_style_bg_color(lv_scr_act(), lv_color_make(0,0,0), 0);//设置背景颜色为白色
-//     lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN);
-//     //lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
-//     lv_obj_set_pos(label1,0,20);
-
-
-
-//     //sgf_lvgl_display(&info);
-//     lv_refr_now(NULL);
-//     // if (wait_second != 0) {
-//     //     ESP_LOGI(TAG, "wait=%ds", wait_second);
-//     //     vTaskDelay(pdMS_TO_TICKS(1000 * wait_second));
-//     // }
-//     // gpio_weekup_init_s(sleep_second);
-
-
-// #endif
-
-
-
-
-
-
-//     //lv_refr_now(disp);
-//     for(;;) {
-
-//       lv_tick_inc(10); /*Use a not round number to cover more anim states */
-//       lv_timer_handler();
-//       vTaskDelay(10 / portTICK_PERIOD_MS);
-//       }
-
-
-
-   
-
-
-// }
-
-
-
-
-
-
-
-
-
-
-
-
-
-

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1864 - 0
sdkconfig - 副本