Fixed bug number 10186.
This commit is contained in:
		
							parent
							
								
									9f91125971
								
							
						
					
					
						commit
						8f549afebd
					
				| 
						 | 
				
			
			@ -417,11 +417,19 @@ BOOL System_GetShutdownBegin(void)
 | 
			
		|||
{
 | 
			
		||||
	return g_IsShutdownBegin;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define DO_NOT_SHOW_POWER_OFF 0
 | 
			
		||||
#define SHOW_POWER_OFF 1
 | 
			
		||||
INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
 | 
			
		||||
{
 | 
			
		||||
	UINT32 displayShow = SHOW_POWER_OFF;
 | 
			
		||||
	if ( paramNum >= 2)
 | 
			
		||||
	{
 | 
			
		||||
	DBG_DUMP("^MOn Shutdown begin paramNum:%d paramArray[0]:%d paramArray[1]:%d\r\n",paramNum, paramArray[0], paramArray[1]);
 | 
			
		||||
		displayShow = paramArray[1];
 | 
			
		||||
	}
 | 
			
		||||
	if (paramNum >= 1 /*&& paramArray[0] == 0*/) 
 | 
			
		||||
	{ //power-off begin
 | 
			
		||||
	DBG_DUMP("^MOn Shutdown begin paramNum:%d paramArray:%d\r\n",paramNum, paramArray[0]);
 | 
			
		||||
	if (paramNum == 1 /*&& paramArray[0] == 0*/) { //power-off begin
 | 
			
		||||
		g_IsShutdownBegin=TRUE;
 | 
			
		||||
 | 
			
		||||
#if (DISPLAY_FUNC == ENABLE)
 | 
			
		||||
| 
						 | 
				
			
			@ -468,7 +476,7 @@ INT32 System_OnShutdown(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
 | 
			
		|||
		} else {
 | 
			
		||||
#if (POWEROFFLOGO_FUNCTION == ENABLE)
 | 
			
		||||
            #if HUNTING_CAMERA_MCU == ENABLE
 | 
			
		||||
            if(sf_get_mode_flag())
 | 
			
		||||
            if(sf_get_mode_flag() && SHOW_POWER_OFF == displayShow)
 | 
			
		||||
            #endif
 | 
			
		||||
            {
 | 
			
		||||
                GxDisplay_Set(LAYER_OSD1, LAYER_STATE_ENABLE, 0); //turn off OSD1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,4 @@
 | 
			
		|||
#include "UIFlowLVGL/UIFlowClose/UIFlowCloseEventCallback.h"
 | 
			
		||||
#include "UIFlowLVGL/UIFlowLVGL.h"
 | 
			
		||||
#include "PrjInc.h"
 | 
			
		||||
#include "ImageApp/ImageApp_Photo.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -9,6 +10,7 @@
 | 
			
		|||
#define UPDATE_TIMEER_MS 200
 | 
			
		||||
static lv_task_t* update_timer = NULL;
 | 
			
		||||
static lv_group_t* gp = NULL;
 | 
			
		||||
static DISPLAY_FINAL_E gPowerOff = DISPLAY_FINAL_END;
 | 
			
		||||
static void set_indev_keypad_group(lv_obj_t* obj)
 | 
			
		||||
{
 | 
			
		||||
	if(gp == NULL){
 | 
			
		||||
| 
						 | 
				
			
			@ -37,7 +39,7 @@ static void task_update_timer_cb(lv_task_t* task)
 | 
			
		|||
    closing_index ++;
 | 
			
		||||
	if (time_ms == 0)
 | 
			
		||||
	{
 | 
			
		||||
        Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO);
 | 
			
		||||
        Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, gPowerOff);
 | 
			
		||||
		if(update_timer){
 | 
			
		||||
			lv_task_del(update_timer);
 | 
			
		||||
			update_timer = NULL;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,8 +47,9 @@ static void task_update_timer_cb(lv_task_t* task)
 | 
			
		|||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
void OpenClosingScreen(void)
 | 
			
		||||
void OpenClosingScreen(const DISPLAY_FINAL_E powerOff)
 | 
			
		||||
{
 | 
			
		||||
	gPowerOff = powerOff;
 | 
			
		||||
	lv_plugin_scr_open(UIFlowClose, NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,5 +3,10 @@
 | 
			
		|||
#include "UIFlowLVGL/UIFlowMenuCommonConfirm/UIFlowMenuCommonConfirmAPI.h"
 | 
			
		||||
#include "UIFlowLVGL/UIFlowLVGL.h"
 | 
			
		||||
#include "Resource/Plugin/lvgl_plugin.h"
 | 
			
		||||
void OpenClosingScreen(void);
 | 
			
		||||
typedef enum {		 
 | 
			
		||||
    DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF = 0,
 | 
			
		||||
	DISPLAY_FINAL_SHOW_POWER_OFF,
 | 
			
		||||
    DISPLAY_FINAL_END
 | 
			
		||||
} DISPLAY_FINAL_E;
 | 
			
		||||
void OpenClosingScreen(const DISPLAY_FINAL_E powerOff);
 | 
			
		||||
#endif /*UIFLOW_CLOSE_EVENT_CALLBACK_H*/
 | 
			
		||||
| 
						 | 
				
			
			@ -531,7 +531,7 @@ static void UIFlowMenuCommonConfirm_MessageBox_ValueChanged(lv_obj_t* obj, uint3
 | 
			
		|||
			BKG_PostEvent(gBKGEvt);
 | 
			
		||||
		} else if (gBKGEvt == NVTEVT_BKW_ENTER_WORK_MODE)
 | 
			
		||||
		{
 | 
			
		||||
			OpenClosingScreen();
 | 
			
		||||
			OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
 | 
			
		||||
			// BKG_PostEvent(gBKGEvt);
 | 
			
		||||
			// UIFlowMenuCommonConfirm_CloseScr();
 | 
			
		||||
		} else if (gBKGEvt) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1624,7 +1624,7 @@ static void task_update_icons_timer_cb(lv_task_t* task)
 | 
			
		|||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
			OpenClosingScreen();
 | 
			
		||||
			OpenClosingScreen(DISPLAY_FINAL_DO_NOT_SHOW_POWER_OFF);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return;
 | 
			
		||||
| 
						 | 
				
			
			@ -1985,7 +1985,7 @@ void UIFlowPhtot_KeyLongPress(lv_obj_t* obj, uint32_t key)
 | 
			
		|||
		if (3 * 1000 <= KeyLeftPressingTimeMs)
 | 
			
		||||
		{
 | 
			
		||||
            // Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO);
 | 
			
		||||
			OpenClosingScreen();
 | 
			
		||||
			OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF);
 | 
			
		||||
			KeyLeftPressingTimeMs = 0;
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,7 +52,7 @@ static void task_msgbox_timer_cb(lv_task_t* task)
 | 
			
		|||
			}
 | 
			
		||||
			if (0 == autoClose)
 | 
			
		||||
			{
 | 
			
		||||
				OpenClosingScreen();
 | 
			
		||||
				OpenClosingScreen(DISPLAY_FINAL_SHOW_POWER_OFF);
 | 
			
		||||
			}
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -290,16 +290,17 @@ void sf_mode_detect(void)
 | 
			
		|||
                //LCD_BACKLIGHT_OFF;			
 | 
			
		||||
                sf_sys_status_led_set(SF_LED_SYS_STATE_POWER_OFF);
 | 
			
		||||
                printf("[power off] %s(%d) AutoOfftime:%d\n", __FUNCTION__, __LINE__, AutoOfftime);
 | 
			
		||||
                #define DO_NOT_SHOW_POWER_OFF 0
 | 
			
		||||
                if(AutoOfftime >= KeepAliveTime_s)
 | 
			
		||||
                {
 | 
			
		||||
                    Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); //shutdown start
 | 
			
		||||
                    Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    #if defined(_MODEL_565_HUNTING_EVB_LINUX_4G_68CS_)
 | 
			
		||||
                    Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_NORMAL); //shutdown start
 | 
			
		||||
                    #elif defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S530_) || defined(_MODEL_565_HUNTING_EVB_LINUX_4G_S550_)
 | 
			
		||||
                    Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); //shutdown start
 | 
			
		||||
                    Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 2, APP_POWER_OFF_APO, DO_NOT_SHOW_POWER_OFF); //shutdown start
 | 
			
		||||
                    #endif
 | 
			
		||||
                }
 | 
			
		||||
                sf_set_power_off_flag(1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user