Browse Source

fix:pm不能正确的休眠和唤醒
update:lvgl的tick在lvgl.init后才可以打开

alienwalker 4 years ago
parent
commit
2b2d28c667

+ 5 - 3
application/include/luat_conf_bsp.h

@@ -74,7 +74,7 @@
 
 #define LUAT_USE_OTA
 
-// 多虚拟机支持,实验性,一般不启用 
+// 多虚拟机支持,实验性,一般不启用
 // #define LUAT_USE_VMX 1 
 // #define LUAT_USE_NES
 
@@ -158,10 +158,12 @@ extern unsigned int gLVFlashTime;
 
 #define LV_NO_BLOCK_FLUSH
 #define time(X)	luat_time(X)
-#endif
 
 #define LV_USE_PERF_MONITOR     1
+#define __LVGL_SLEEP_ENABLE__
+
 #ifndef __DEBUG__
 #undef LV_USE_PERF_MONITOR
 #endif
-//#define LV_ATTRIBUTE_FAST_MEM	__attribute__((section (".RamFunc")))
+
+#endif

+ 4 - 0
application/src/luat_base_air105.c

@@ -281,8 +281,12 @@ void luat_base_init(void)
   gLVFlashTime = 33;
 	lv_init();
 	lv_timer = Timer_Create(_lvgl_handler, NULL, NULL);
+#ifdef __LVGL_SLEEP_ENABLE__
+    luat_lvgl_tick_sleep(1);
+#else
 	Timer_StartMS(lv_timer, LVGL_TICK_PERIOD, 1);
 #endif
+#endif
 }
 
 time_t luat_time(time_t *_Time) {

+ 13 - 6
application/src/luat_pm_air105.c

@@ -6,16 +6,23 @@
 #include "luat_log.h"
 
 int luat_pm_request(int mode) {
-    if (mode != LUAT_PM_SLEEP_MODE_LIGHT || mode == LUAT_PM_SLEEP_MODE_DEEP) {
-        LLOGW("only pm.LIGHT/pm.DEEP supported");
-        return -1;
-    }
-    uint8_t i;
+//    if (mode != LUAT_PM_SLEEP_MODE_LIGHT || mode == LUAT_PM_SLEEP_MODE_DEEP) {
+//        LLOGW("only pm.LIGHT/pm.DEEP supported");
+//        return -1;
+//    }
+//    uint8_t i;
 //    for(i = UART_ID1; i< UART_MAX; i++)
 //    {
 //    	Uart_Sleep(i, 0);
 //    }
-    PM_SetDriverRunFlag(PM_DRV_DBG, 0);
+	if (mode != LUAT_PM_SLEEP_MODE_IDLE)
+	{
+		PM_SetDriverRunFlag(PM_DRV_DBG, 0);
+	}
+	else
+	{
+		PM_SetDriverRunFlag(PM_DRV_DBG, 1);
+	}
     return 0;
 }