1.按键调整
2.alg分辨率调整,修复却换视频模式是卡画面问题 3.加logo一些log
This commit is contained in:
parent
3f16cfaa20
commit
19a5bd3278
|
@ -15,12 +15,24 @@
|
||||||
/** \addtogroup mIPRJAPKeyIO */
|
/** \addtogroup mIPRJAPKeyIO */
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
|
#include "PrjInc.h"
|
||||||
#include "DxCfg.h"
|
#include "DxCfg.h"
|
||||||
#include "IOCfg.h"
|
#include "IOCfg.h"
|
||||||
#include "DxInput.h"
|
#include "DxInput.h"
|
||||||
#include "KeyDef.h"
|
#include "KeyDef.h"
|
||||||
#include "comm/hwclock.h"
|
#include "comm/hwclock.h"
|
||||||
#include "comm/hwpower.h"
|
#include "comm/hwpower.h"
|
||||||
|
#include "kwrap/perf.h"
|
||||||
|
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
#include <sf_common.h>
|
||||||
|
#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
|
#if 0
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
#include "Delay.h"
|
#include "Delay.h"
|
||||||
|
@ -135,6 +147,20 @@ static void DrvKey_DetKeyDelay(void)
|
||||||
void DrvKey_Init(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.
|
Detect normal key is pressed or not.
|
||||||
|
|
||||||
|
@ -147,7 +173,24 @@ void DrvKey_Init(void)
|
||||||
UINT32 DrvKey_DetNormalKey(void)
|
UINT32 DrvKey_DetNormalKey(void)
|
||||||
{
|
{
|
||||||
UINT32 uiKeyCode = 0;
|
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)
|
#if (ADC_KEY == ENABLE)
|
||||||
UINT32 uiKey1Lvl = VolDet_GetKey1Level();
|
UINT32 uiKey1Lvl = VolDet_GetKey1Level();
|
||||||
switch (uiKey1Lvl) {
|
switch (uiKey1Lvl) {
|
||||||
|
@ -174,26 +217,157 @@ UINT32 DrvKey_DetNormalKey(void)
|
||||||
|
|
||||||
|
|
||||||
#if (GPIO_KEY == ENABLE)
|
#if (GPIO_KEY == ENABLE)
|
||||||
|
|
||||||
if (gpio_getPin(GPIO_KEY_SHUTTER2)) {
|
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)) {
|
if (gpio_getPin(GPIO_KEY_UP)) {
|
||||||
uiKeyCode |= FLGKEY_UP;
|
uiKeyCode |= FLGKEY_UP;
|
||||||
}
|
}
|
||||||
if (gpio_getPin(GPIO_KEY_DOWN)) {
|
if (gpio_getPin(GPIO_KEY_DOWN)) {
|
||||||
uiKeyCode |= FLGKEY_DOWN;
|
uiKeyCode |= FLGKEY_DOWN;
|
||||||
}
|
}
|
||||||
// if (gpio_getPin(GPIO_KEY_MENU)) {
|
|
||||||
// uiKeyCode |= FLGKEY_MENU;
|
if(gpio_getPin(GPIO_KEY_RIGHT))
|
||||||
// }
|
{
|
||||||
// if (!gpio_getPin(GPIO_KEY_PLAYBACK)) {
|
if(0 == RightFlag){
|
||||||
// uiKeyCode |= FLGKEY_MENU;
|
vos_perf_mark(&RightTtick);
|
||||||
// }
|
RightFlag = 1;
|
||||||
if (gpio_getPin(GPIO_KEY_RIGHT)) {
|
|
||||||
uiKeyCode |= FLGKEY_RIGHT;
|
|
||||||
}
|
}
|
||||||
if (!gpio_getPin(GPIO_KEY_LEFT)) {
|
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)))
|
||||||
|
{
|
||||||
|
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;
|
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)) {
|
if (gpio_getPin(GPIO_KEY_DATAREADY)) {
|
||||||
uiKeyCode |= FLGKEY_DATAREADY;
|
uiKeyCode |= FLGKEY_DATAREADY;
|
||||||
|
|
|
@ -724,6 +724,8 @@ void Display_ShowSplash(SPLASH_ID splash_id)
|
||||||
//show logo
|
//show logo
|
||||||
DBG_IND("Show Logo\r\n");
|
DBG_IND("Show Logo\r\n");
|
||||||
UI_ShowJPG(LOGO_DISP_LAYER, (UINT32)p_gLogoJPG, p_gLogoSize);
|
UI_ShowJPG(LOGO_DISP_LAYER, (UINT32)p_gLogoJPG, p_gLogoSize);
|
||||||
|
DBG_IND("Show Logo e\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
void Display_HideSplash(void)
|
void Display_HideSplash(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -204,7 +204,7 @@ MOVIE_ALG_INFO gMovie_Alg_Info[] = {
|
||||||
#if (_BOARD_DRAM_SIZE_ == 0x04000000 || (SENSOR_CAPS_COUNT& SENSOR_ON_MASK)==0)
|
#if (_BOARD_DRAM_SIZE_ == 0x04000000 || (SENSOR_CAPS_COUNT& SENSOR_ON_MASK)==0)
|
||||||
{0, 0}, // image size
|
{0, 0}, // image size
|
||||||
#else
|
#else
|
||||||
{640, 640}, // image size
|
{640, 480}, // image size
|
||||||
#endif
|
#endif
|
||||||
{0, 0, 0, 0}, // window size
|
{0, 0, 0, 0}, // window size
|
||||||
3, // fps
|
3, // fps
|
||||||
|
|
Loading…
Reference in New Issue
Block a user