📄 joetoevb.c
字号:
XBYTE[0x2b07] = 0x10;
L2_SetGPIOBit(29,0);//wendy
}
#else
XBYTE[0x203a] |= 0x08; //gpio19
// XBYTE[0x203a] |= 0x02; //gpio17
if (OnOff > 0)
{
XBYTE[0x2032] |= 0x08;
// XBYTE[0x2032] |= 0x02;//gpio17
}
else
{
XBYTE[0x2032] &= 0xf7;
}
#endif
/* if (OnOff)
{
XBYTE[0x2090] = 0x00; // f = 1s
XBYTE[0x2091] = 0x00;
XBYTE[0x2092] = 0x60;
XBYTE[0x2094] = 0x02;
XBYTE[0x2095] = 0x00;
XBYTE[0x2096] = 0x00;
XBYTE[0x2097] = 0x00;
XBYTE[0x2093] = 0x01;
XBYTE[0x2099] = 0xf0;
XBYTE[0x209d] = 0x01;
XBYTE[0x209c] = 0x04;
XBYTE[0x209e] = 0x03;
}
else
{
XBYTE[0x209c] = 0x00;
}
*/
}
//=============================================================================
//UI_FlashLight_Charge
//=============================================================================
void UI_FlashLight_Charge(void) USING_0
{
USHORT status;
UCHAR FOSD_H_num, FOSD_V_num;
UI_GetFOSDSize(&FOSD_H_num, &FOSD_V_num);
status = G_UIStatusH& 0xff00;
//wendy@2004/9/8
if(G_FlashChargeFlag==2)
{
if(G_FlashChargeCount<70/*60*/)
{
return;
}
else
{
G_FlashChargeCount=0;
G_FlashChargeFlag=0;
}
}
//wendy@2004/9/8
if((G_UI_USBConnect == K_UI_USB_DISCONNECT) && (G_UIStatusH == K_UISTATUS_DSC_PREVIEW))//wendy@2004/9/8
{
if (G_Refresh_Status_OSD == 1)
{
if (G_StayInMenu)
{
UI_DestroyMenu();
}
G_Refresh_Status_OSD = 0;
L2_SetFOSDIndex(0,FOSD_H_num-9,G_FlashStatus*2 + 0x12);
L2_SetFOSDAttr(0,FOSD_H_num-9, UI_MENU_DEHIGHLIGHT_COLOR);
L2_SetFOSDIndex(0,FOSD_H_num-8,G_FlashStatus*2 + 0x13);
L2_SetFOSDAttr(0,FOSD_H_num-8, UI_MENU_DEHIGHLIGHT_COLOR);
if (G_FlashStatus == K_FlashLightOff)
{
UI_FlashLight_Power(0);
G_FlashCharging = 0;
G_FlashChargingCount = 0;
UI_BusyLed(0);
G_FlashChargeFlag=0;//wendy@2004/9/8
G_FlashChargeCount=0;//wendy@2004/9/8
}
}
if (G_FlashStatus != K_FlashLightOff)
{
#if(TURNKEY_OPTION == 1)
#if 1
// L2_ConfigGPIOBit(3,0); //charge_ok
if(XBYTE[0x2040] & 0x08) //Gpio4 //charge_ok //liliuhai
#else
if(XBYTE[0x2dc8] & 0x02)
#endif
#else
if(XBYTE[0x2040] & 0x08)
#endif
{
if (G_FlashChargingCount >= 150)//200 //Turn off flash light when the charging is over 20 sec //davis2004/11/26 modify
{
UI_FlashLight_Power(0);
G_FlashCharging = 0;
G_FlashChargeFlag=0;//wendy@2004/9/8
G_FlashChargeCount=0;//wendy@2004/9/8
G_FlashChargingCount = 0;
UI_BusyLed(0);
//wendy@2004/9/9
L2_SetGPIOBit(14,1); //POWER_CTRL
//davis2004/11/26 add-------------------------
G_usZoomOSDTimer =0;
UI_PreviewInit();
//---------------------------------------
L2_TurnOnOffDisplay (1); //debug
G_FlashChargeFlag=0;//wendy@2004/9/8
G_FlashStatus = K_FlashLightOff;
UI_BusyLed(0);//wendy@2004/9/9
L2_SetFOSDIndex(0,FOSD_H_num-9,G_FlashStatus*2 + 0x12);
L2_SetFOSDAttr(0,FOSD_H_num-9, UI_MENU_DEHIGHLIGHT_COLOR);
L2_SetFOSDIndex(0,FOSD_H_num-8,G_FlashStatus*2 + 0x13);
L2_SetFOSDAttr(0,FOSD_H_num-8, UI_MENU_DEHIGHLIGHT_COLOR);
}
else
{
if (G_FlashCharging == 0)
{
//G_AutoPowerOffCount = 0;
G_FlashCharging = 1;
}
else if(G_FlashCharging == 1)
{
UI_FlashLight_Power(1); //Start charging
L2_SetFOSDIndex(0,FOSD_H_num-9,G_FlashStatus*2 + 0x12);
L2_SetFOSDAttr(0,FOSD_H_num-9, UI_MENU_DEHIGHLIGHT_COLOR | UI_MENU_BLINKING);
L2_SetFOSDIndex(0,FOSD_H_num-8,G_FlashStatus*2 + 0x13);
L2_SetFOSDAttr(0,FOSD_H_num-8, UI_MENU_DEHIGHLIGHT_COLOR | UI_MENU_BLINKING);
G_FlashChargeFlag=1;//wendy@2004/9/8
G_FlashChargeCount=0;
L2_TurnOnOffDisplay (0); //debug
//davis2004/11/26 add --------------------
//----------------------------------
}
else if(G_FlashCharging == 2)
{
if (G_FlashChargingCount > 10)
{
G_FlashCharging = 1;
}
}
else if(G_FlashCharging == 3)
{
//G_AutoPowerOffCount = 0;
G_FlashChargeFlag=2;//wendy@2004/9/8
G_FlashChargeCount=0;
G_FlashCharging = 2;
}
}
}
else //Stop charging if the flash light key be pressed again or the voltage is enough
{
if (G_FlashCharging ==0)
{
G_FlashCharging =1;
}
if (G_FlashCharging ==1)
{
G_FlashCharging = 0;
G_FlashChargingCount = 0;
G_FlashCharging = 2;
UI_BusyLed(0);
L2_SetFOSDIndex(0,FOSD_H_num-9,G_FlashStatus*2 + 0x12);
L2_SetFOSDAttr(0,FOSD_H_num-9, UI_MENU_DEHIGHLIGHT_COLOR);
L2_SetFOSDIndex(0,FOSD_H_num-8,G_FlashStatus*2 + 0x13);
L2_SetFOSDAttr(0,FOSD_H_num-8, UI_MENU_DEHIGHLIGHT_COLOR);
}
else if ( (G_FlashCharging ==2) && (G_FlashChargingCount > 10) )
{
UI_FlashLight_Power(0);
//davis2004/11/26 add-------------------------
G_usZoomOSDTimer =0;
UI_PreviewInit();
//---------------------------------------
L2_TurnOnOffDisplay (1); //debug
L2_SetGPIOBit(14,1); //POWER_CTRL
UI_BusyLed(1);//wendy@2004/9/9
G_FlashCharging = 0;
G_FlashChargingCount = 0;
G_FlashCharging = 3;
G_FlashChargeFlag=2;//wendy@2004/9/8
G_FlashChargeCount=0;//wendy@2004/9/8
//wendy@2004/9/9
}
}
}
}
else // usb mode
{
G_FlashStatus = K_FlashLightOff;
UI_BusyLed(0);//wendy@2004/9/9
//UI_FlashLight_Power(0);
XBYTE[0x2030] &= 0xef;
XBYTE[0x2038] |= 0x10; //gpio4
G_FlashCharging = 0;
G_FlashChargingCount = 0;
G_FlashChargeFlag=0;//wendy@2004/9/8
G_FlashChargeCount=0;//wendy@2004/9/8
}
}
//=============================================================================
//UI_FlashLight_Power
//=============================================================================
void UI_FlashLight_Power(UCHAR On) USING_0
{
#if (TURNKEY_OPTION == 0)
L2_ConfigGPIOBit(4,1); //gpio 3
if (On > 0)
{
L2_SetGPIOBit(4,1);
DeletLowBattEN=0;
}
else
{
L2_SetGPIOBit(4,0);
DeletLowBattEN=1;
}
#else
if (On)
{
XBYTE[0x2030] |= 0x10;
G_FlashOnFlag=1;//wendy@2004/9/28
}
else
{
if(G_FlashOnFlag)//wendy@2004/9/28
{
//XBYTE[0x2038] |= 0x10; //gpio4
XBYTE[0x2030] &= 0xef;
G_FlashOnFlag=0;//wendy@2004/9/28
}
}
XBYTE[0x2038] |= 0x10; //gpio4
#endif
}
//=============================================================================
//UI_FlashLight_Trigger
//=============================================================================
void UI_FlashLight_Trigger(USHORT flashtime) USING_0
{
XBYTE[0x201B] = 0x01;
if ((G_FlashStatus != K_FlashLightOff) && (G_FlashCharging > 1))
{
L2_SetFlash(flashtime,0,0);
STROBE = 1;
G_FlashCharging = 0;
G_FlashChargingCount = 0;
G_FlashChargeFlag= 0;//wendy@2004/9/9
// G_FlashStatus = 0x01;
UI_BusyLed(0);
}
else
{
STROBE = 0;
}
}
//-----------------------------------------------------------------------------
//UI_SensorPowerOnOff
//-----------------------------------------------------------------------------
void UI_SensorPowerOnOff(UCHAR On) USING_0
{
if (On)
{
XBYTE[0x2030] |= 0x40;
G_SensorPowerOnOff = 1;
DELAY_100ms();
UI_SensorReset();
DELAY_100ms();//wendy@2004/9/24
}
else
{
XBYTE[0x2030] &= 0xbf;
G_SensorPowerOnOff = 0;
}
XBYTE[0x2038] |= 0x40; //gpio6
}
//-----------------------------------------------------------------------------
//UI_LCDReset
//-----------------------------------------------------------------------------
void UI_LCDReset(void) USING_0
{
XBYTE[0x2D76]|= 0x04; //wendy@2004/8/5
XBYTE[0x2D73]&= 0xfb; //wendy@2004/8/5
DELAY_10ms();
XBYTE[0x2D73]|= 0x04; //wendy@2004/8/5
DELAY_10ms();
}
//-----------------------------------------------------------------------------
//UI_SensorReset
//-----------------------------------------------------------------------------
void UI_SensorReset(void) USING_0
{
#if (TURNKEY_OPTION == 1)//wendy@2004//8/12
XBYTE[0x2038] |= 0x80;
#ifdef OV13 // High reset
{
XBYTE[0x2030] |= 0x80;
DELAY_10ms();
XBYTE[0x2030] &= 0x7f;
DELAY_10ms();
}
#endif
#ifdef OV2610 // High reset
{
XBYTE[0x2030] |= 0x80;
DELAY_10ms();
XBYTE[0x2030] &= 0x7f;
DELAY_10ms();
}
#endif
#ifdef MCM20027 // High reset
{
XBYTE[0x2030] |= 0x80;
DELAY_10ms();
XBYTE[0x2030] &= 0x7f;
DELAY_10ms();
}
#endif
/*#ifdef // Low reset
{
XBYTE[0x2030] &= 0x7f;
DELAY_10ms();
XBYTE[0x2030] |= 0x80;
DELAY_10ms();
}
#endif*/
#ifdef OV3610 // High reset
{
XBYTE[0x2030] |= 0x80;
DELAY_10ms();
XBYTE[0x2030] &= 0x7f;
DELAY_10ms();
}
#endif
//XBYTE[0x2038] &= 0x7f;//wendy@2004/8/26
#endif
}
//-----------------------------------------------------------------------------
//UI_CardPowerOnOff
//-----------------------------------------------------------------------------
void UI_CardPowerOnOff(UCHAR On) USING_0
{
#if (TURNKEY_OPTION == 0)
XBYTE[0x2039] |= 0x80;
if (On)
{
XBYTE[0x2031] |= 0x80;
}
else
{
XBYTE[0x2031] &= 0x7f;
}
DELAY_100ms();
#endif
#if 1 ///liliuhai
L2_ConfigGPIOBit(1,1);
if (On)
{
L2_SetGPIOBit(1,1);
}
else
{
L2_SetGPIOBit(1,0);
}
DELAY_100ms();
#endif
}
//turnkey_patch2.2@ada@Fix the bug that can not power off during function begin
//-----------------------------------------------------------------------------
//UI_TimeOutCancelMenu
//-----------------------------------------------------------------------------
void UI_TimeOutCancelMenu(UCHAR timeout) USING_0
{
if (timeout > 0)
{
if (G_StayInMenuCount >= 100)
{
G_StayInMenuCount = 0;
if (((G_UIStatusH& 0xfff0) == K_UISTATUS_DSC_PLAY_ERASE_ALL)&&((G_UIStatus & 0xfff0) == K_UISTATUS_DSC_PLAY_ERASE_ONE))
{
G_UIStatus = K_UISTATUS_DSC_PLAY;
G_UIStatusH= K_UISTATUS_DSC_PLAY;
}
UI_DestroyMenu();
}
}
}
//turnkey_patch2.2@ada@Fix the bug that can not power off during function end
//=============================================================================
//UI_ShowGoodBye
//=============================================================================
void UI_ShowGoodBye(void) USING_0
{
UCHAR width, height;
UCHAR tmp;
tmp = MemStretch;
MemStretch = 0x01;
XBYTE[0x2D18] &= 0x7f;
MemStretch = tmp;
L2_SetColorPalette(8,0,0,255);
UI_ClearFOSD(25, 8, 0x08);
UI_GetFOSDSize(&width, &height);
L2_CtrlScreen(1);
UI_PrintOSDString(GOOD_BYE[0], width / 2 - 3, height / 2 , UI_MENU_BG_COLOR_ON | UI_MENU_DEHIGHLIGHT_COLOR);
}
//=============================================================================
//UI_ShowLowBattery
//=============================================================================
void UI_ShowLowBattery(void) USING_0
{
UCHAR width, height;
UCHAR tmp;
tmp = MemStretch;
MemStretch = 0x01;
XBYTE[0x2D18] &= 0x7f;
MemStretch = tmp;
L2_SetColorPalette(8,0,0,255);
UI_ClearFOSD(25, 8, 0x08);
UI_GetFOSDSize(&width, &height);
L2_CtrlScreen(1);
UI_PrintOSDString(LOW_BATTERY[G_Language], width / 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -