From 19a5bd32789a514e43f0e8786ab85832e4868a21 Mon Sep 17 00:00:00 2001 From: payton Date: Sat, 7 Oct 2023 09:45:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8C=89=E9=94=AE=E8=B0=83=E6=95=B4=202.alg?= =?UTF-8?q?=E5=88=86=E8=BE=A8=E7=8E=87=E8=B0=83=E6=95=B4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=8D=B4=E6=8D=A2=E8=A7=86=E9=A2=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=98=AF=E5=8D=A1=E7=94=BB=E9=9D=A2=E9=97=AE=E9=A2=98=203.?= =?UTF-8?q?=E5=8A=A0logo=E4=B8=80=E4=BA=9Blog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DxInput_Key.c | 196 +++++++++++++++++- .../cardv/SrcCode/System/SysVideo_Exe.c | 2 + .../UIApp/Movie/UIAppMovie_RecSetting.c | 2 +- 3 files changed, 188 insertions(+), 12 deletions(-) diff --git a/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S550/DxInput_Key.c b/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S550/DxInput_Key.c index 6b6279588..472896247 100755 --- a/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S550/DxInput_Key.c +++ b/code/application/source/cardv/SrcCode/Dx/565_HUNTING_EVB_LINUX_4G_S550/DxInput_Key.c @@ -15,12 +15,24 @@ /** \addtogroup mIPRJAPKeyIO */ //@{ +#include "PrjInc.h" #include "DxCfg.h" #include "IOCfg.h" #include "DxInput.h" #include "KeyDef.h" #include "comm/hwclock.h" #include "comm/hwpower.h" +#include "kwrap/perf.h" + +#if HUNTING_CAMERA_MCU == ENABLE +#include +#include "sf_sd_common.h" +#include "sf_mcu.h" +#endif +#include "sf_sd_common.h" +#include "sf_message_queue.h" +#include "sf_param_enum.h" + #if 0 #include "rtc.h" #include "Delay.h" @@ -135,6 +147,20 @@ static void DrvKey_DetKeyDelay(void) void DrvKey_Init(void) { } + +static UINT32 KeyTestPressCnt = 0; +static UINT32 SendKeyCnt = 0; + +static UINT32 LeftKeyPressCnt = 0; +static UINT32 LeftSendKeyCnt = 0; + +static UINT32 RightKeyPressCnt = 0; +static UINT32 RightSendKeyCnt = 0; + +//static BOOL KeyPress_Long = FALSE; + +#define LongKey_Cnt (40)// times +#define SendKey_LessCnt (6 + 1)///(6 + 1)//6 :vaild times /** Detect normal key is pressed or not. @@ -147,7 +173,24 @@ void DrvKey_Init(void) UINT32 DrvKey_DetNormalKey(void) { UINT32 uiKeyCode = 0; + VOS_TICK tticktmp=0; + static VOS_TICK ttick=0; + static UINT32 timeflag = 0; + static UINT32 cmdflag = 0; + static UINT32 time = 0; + static UINT32 LeftCmdflag = 0; + static VOS_TICK LeftTtick=0; + static UINT32 LeftFlag = 0; + static UINT32 LeftPressFlag = 0; + static UINT32 LeftTime = 0; + + static UINT32 RightCmdflag = 0; + static VOS_TICK RightTtick=0; + static UINT32 RightFlag = 0; + //static UINT32 RightPressFlag = 0; + static UINT32 RightTime = 0; + //static UINT32 retset_cmdflag = 0; #if (ADC_KEY == ENABLE) UINT32 uiKey1Lvl = VolDet_GetKey1Level(); switch (uiKey1Lvl) { @@ -174,26 +217,157 @@ UINT32 DrvKey_DetNormalKey(void) #if (GPIO_KEY == ENABLE) + if (gpio_getPin(GPIO_KEY_SHUTTER2)) { - uiKeyCode |= FLGKEY_SHUTTER2; + if(0 == timeflag){ + vos_perf_mark(&ttick); + timeflag = 1; + } + KeyTestPressCnt++; + vos_perf_mark(&tticktmp); + time = ((tticktmp/1000) - (ttick/1000)); + if(0 == sf_get_fw_update()){ + if((!cmdflag) && (time >= 3000) && (!LeftPressFlag)) + { + cmdflag = 1; + printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_NORMAL); + } + + } + }else{ + if(KeyTestPressCnt && (0 == sf_get_fw_update())){ + + if((!cmdflag) && (time >= 3000) && (sf_get_pir_statu_flag())){ + printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + cmdflag = 1; + //sf_set_card_statu(CMD_FORMAT_SD_STA); + //BKG_PostEvent(NVTEVT_BKW_FORMAT_CARD); + } + // else if((!cmdflag) && (time >= 3000) && (retset_time >= 3000) && (!sf_get_pir_statu_flag())){ + // printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms retset_time:%dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time, retset_time); + // cmdflag = 1; + // sf_set_debug_mode(); + // } + // else if((!cmdflag) && (time >= 10000) && (FALSE == sf_check_net_work_flag()) && (!sf_get_pir_statu_flag())){ + // printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + // cmdflag = 1; + // sf_set_module_update(1); + // } + else if((++SendKeyCnt < SendKey_LessCnt) && (!cmdflag)){//shot key + printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + uiKeyCode |= FLGKEY_SHUTTER2; + }else { + printf("[%s:%d] SendKeyCnt:%d KeyTestPressCnt:%d time: %dms\n", __FUNCTION__, __LINE__, SendKeyCnt, KeyTestPressCnt, time); + + SendKeyCnt = 0; + KeyTestPressCnt = 0; + timeflag = 0; + ttick = 0; + cmdflag = 0; + } + + }else{ + SendKeyCnt = 0; + KeyTestPressCnt = 0; + timeflag = 0; + ttick = 0; + cmdflag = 0; + } } + if (gpio_getPin(GPIO_KEY_UP)) { uiKeyCode |= FLGKEY_UP; } if (gpio_getPin(GPIO_KEY_DOWN)) { uiKeyCode |= FLGKEY_DOWN; } - // if (gpio_getPin(GPIO_KEY_MENU)) { - // uiKeyCode |= FLGKEY_MENU; - // } -// if (!gpio_getPin(GPIO_KEY_PLAYBACK)) { -// uiKeyCode |= FLGKEY_MENU; -// } - if (gpio_getPin(GPIO_KEY_RIGHT)) { - uiKeyCode |= FLGKEY_RIGHT; + + if(gpio_getPin(GPIO_KEY_RIGHT)) + { + if(0 == RightFlag){ + vos_perf_mark(&RightTtick); + RightFlag = 1; + } + RightKeyPressCnt++; + vos_perf_mark(&tticktmp); + RightTime = ((tticktmp/1000) - (RightTtick/1000)); + if((!RightCmdflag) && (RightTime >= 5000)) + { + RightCmdflag = 1; + sf_save_camera_info(); + vos_perf_mark(&ttick); + } + + }else { + + if(RightKeyPressCnt && (0 == sf_get_fw_update())){ + + if((++RightSendKeyCnt < SendKey_LessCnt) && (!RightCmdflag)){//shot key + printf("[%s:%d] RightSendKeyCnt:%d RightKeyPressCnt:%d RightTime: %dms\n", __FUNCTION__, __LINE__, RightSendKeyCnt, RightKeyPressCnt, RightTime); + uiKeyCode |= FLGKEY_RIGHT; + }else { + printf("[%s:%d] RightSendKeyCnt:%d RightKeyPressCnt:%d RightTime: %dms\n", __FUNCTION__, __LINE__, RightSendKeyCnt, RightKeyPressCnt, RightTime); + + RightSendKeyCnt = 0; + RightKeyPressCnt = 0; + RightFlag = 0; + RightTtick = 0; + RightCmdflag = 0; + } + + }else{ + RightSendKeyCnt = 0; + RightKeyPressCnt = 0; + RightFlag = 0; + RightTtick = 0; + RightCmdflag = 0; + } + + } - if (!gpio_getPin(GPIO_KEY_LEFT)) { - uiKeyCode |= FLGKEY_LEFT; + + if(!(gpio_getPin(GPIO_KEY_LEFT))) + { + if(0 == LeftFlag){ + vos_perf_mark(&LeftTtick); + LeftFlag = 1; + } + LeftKeyPressCnt++; + vos_perf_mark(&tticktmp); + LeftTime = ((tticktmp/1000) - (LeftTtick/1000)); + if((!LeftCmdflag) && (LeftTime >= 3000)) + { + LeftCmdflag = 1; + printf("[%s:%d] LeftSendKeyCnt:%d LeftKeyPressCnt:%d LeftTime: %dms\n", __FUNCTION__, __LINE__, LeftSendKeyCnt, LeftKeyPressCnt, LeftTime); + Ux_PostEvent(NVTEVT_SYSTEM_SHUTDOWN, 1, APP_POWER_OFF_APO); + } + }else { + + if(LeftKeyPressCnt && (0 == sf_get_fw_update())){ + + if((++LeftSendKeyCnt < SendKey_LessCnt) && (!LeftCmdflag)){//shot key + printf("[%s:%d] LeftSendKeyCnt:%d LeftKeyPressCnt:%d LeftTime: %dms\n", __FUNCTION__, __LINE__, LeftSendKeyCnt, LeftKeyPressCnt, LeftTime); + uiKeyCode |= FLGKEY_LEFT; + }else { + printf("[%s:%d] LeftSendKeyCnt:%d LeftKeyPressCnt:%d LeftTime: %dms\n", __FUNCTION__, __LINE__, LeftSendKeyCnt, LeftKeyPressCnt, LeftTime); + + LeftSendKeyCnt = 0; + LeftKeyPressCnt = 0; + LeftFlag = 0; + LeftTtick = 0; + LeftCmdflag = 0; + } + + }else{ + LeftSendKeyCnt = 0; + LeftKeyPressCnt = 0; + LeftFlag = 0; + LeftTtick = 0; + LeftCmdflag = 0; + } + + } if (gpio_getPin(GPIO_KEY_DATAREADY)) { uiKeyCode |= FLGKEY_DATAREADY; diff --git a/code/application/source/cardv/SrcCode/System/SysVideo_Exe.c b/code/application/source/cardv/SrcCode/System/SysVideo_Exe.c index bbc564d21..27546f6ab 100755 --- a/code/application/source/cardv/SrcCode/System/SysVideo_Exe.c +++ b/code/application/source/cardv/SrcCode/System/SysVideo_Exe.c @@ -724,6 +724,8 @@ void Display_ShowSplash(SPLASH_ID splash_id) //show logo DBG_IND("Show Logo\r\n"); UI_ShowJPG(LOGO_DISP_LAYER, (UINT32)p_gLogoJPG, p_gLogoSize); + DBG_IND("Show Logo e\r\n"); + } void Display_HideSplash(void) { diff --git a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_RecSetting.c b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_RecSetting.c index 0a8cb0c5a..a0577e88f 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_RecSetting.c +++ b/code/application/source/cardv/SrcCode/UIApp/Movie/UIAppMovie_RecSetting.c @@ -204,7 +204,7 @@ MOVIE_ALG_INFO gMovie_Alg_Info[] = { #if (_BOARD_DRAM_SIZE_ == 0x04000000 || (SENSOR_CAPS_COUNT& SENSOR_ON_MASK)==0) {0, 0}, // image size #else - {640, 640}, // image size + {640, 480}, // image size #endif {0, 0, 0, 0}, // window size 3, // fps