📄 joetoevb.c
字号:
{
k++;
k--;
}
L2_SetGPIOBit(17,0);
for (j = 0; j < 18; j++)
{
k++;
k--;
}
}
EA = 1;*/
if(G_CameraOptions.Buzzer)//Davis@2004/9/6
{
XBYTE[0x2090] = 0x69; // bit-timer = 1/4k
XBYTE[0x2091] = 0x18;
XBYTE[0x2094] = 0x40;
XBYTE[0x2095] = 0x00;
XBYTE[0x2096] = 0x00;
XBYTE[0x2097] = 0x00;
XBYTE[0x2093] = 0x01;
XBYTE[0x2098] = 0x55;//wendy@2004/8/31
XBYTE[0x209d] = 0x01;
XBYTE[0x209c] = 0x01;
XBYTE[0x209e] = 0x03;
}
}
//=============================================================================
//UI_Buzzer1//wendy@2004/9/7
//=============================================================================
void UI_Buzzer1(void) USING_0
{
/*data USHORT i;
data USHORT j;
data UCHAR k = 2;
EA = 0;
L2_ConfigGPIOBit(17,1); //Buzzer(high active)
for (i = 0; i < 1000; i++)
{
L2_SetGPIOBit(17,1);
for (j = 0; j < 18; j++)
{
k++;
k--;
}
L2_SetGPIOBit(17,0);
for (j = 0; j < 18; j++)
{
k++;
k--;
}
}
EA = 1;*/
XBYTE[0x2090] = 0x69; // bit-timer = 1/4k
XBYTE[0x2091] = 0x18;
XBYTE[0x2094] = 0x40;
XBYTE[0x2095] = 0x00;
XBYTE[0x2096] = 0x00;
XBYTE[0x2097] = 0x00;
XBYTE[0x2093] = 0x08;
XBYTE[0x2098] = 0xe0;//0x55;//wendy@2004/8/31
XBYTE[0x209d] = 0x01;
XBYTE[0x209c] = 0x01;
XBYTE[0x209e] = 0x03;
}
//=============================================================================
//UI_BusyLed
//=============================================================================
void UI_BusyLed(UCHAR OnOff) USING_0
{
#if (TURNKEY_OPTION == 1)
L2_ConfigGPIOBit(30,1);
if (OnOff > 0)
{
L2_SetGPIOBit(30,1);//wendy
}
else
{
L2_SetGPIOBit(30,0);
}
#else
XBYTE[0x203a] |= 0x04; //gpio 18
if (OnOff > 0)
{
XBYTE[0x2032] |= 0x04;
}
else
{
XBYTE[0x2032] &= 0xfb;
}
#endif
}
//=============================================================================
//UI_SelfTimerLed
//=============================================================================
void UI_SelfTimerLed(UCHAR OnOff) USING_0
{
#if (TURNKEY_OPTION == 1)
L2_ConfigGPIOBit(29,1);
XBYTE[0x2008] |= 0x10; //Mshutter output enable
if (OnOff)
{
XBYTE[0x2b07] = 0x11; //Mshutter is Self Timer LED(high active)
L2_SetGPIOBit(29,1);//wendy
}
else
{
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)
{ //Davis:patch5.0.0.4_2005/Jul/20
if(G_FlashChargeCount<20/*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
//Davis:patch5.0.0.5_2005/Jul/19 L2_SetGPIOBit(14,1); //POWER_CTRL
//davis2004/11/26 add-------------------------
if (G_SensorPowerOnOff == 0)
{
UI_SensorPowerOnOff(1);
DELAY_100ms();//davis2004/11/4
XBYTE[0x2080] = 0x01; //power on TGPLL
L2_InitFront(0);
L2_InitAEAW(0);
}
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 --------------------
if (G_SensorPowerOnOff == 1)
{
UI_SensorPowerOnOff(0);
}
//----------------------------------
}
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-------------------------
if (G_SensorPowerOnOff == 0)
{
UI_SensorPowerOnOff(1);
DELAY_100ms();//davis2004/11/4
XBYTE[0x2080] = 0x01; //power on TGPLL
L2_InitFront(0);
L2_InitAEAW(0);
}
G_usZoomOSDTimer =0;
UI_PreviewInit();
//---------------------------------------
L2_TurnOnOffDisplay (1); //debug
//Davis:patch5.0.0.5_2005/Jul/19 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);
}
else
{
L2_SetGPIOBit(4,0);
}
#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
}
else
{
STROBE = 0;
}
}
//-----------------------------------------------------------------------------
//UI_SensorPowerOnOff
//-----------------------------------------------------------------------------
void UI_SensorPowerOnOff(UCHAR On) USING_0
{
#if (TURNKEY_OPTION == 0)//wendy@2004//8/12
L2_ConfigGPIOBit(6,1); //Gpio6
if (On > 0)
{
L2_SetGPIOBit(6,1);
G_SensorPowerOnOff = 1;
DELAY_100ms();
// UI_SensorReset();
// XBYTE[0x2038] &= 0xbf; //gpio6
}
else
{
L2_SetGPIOBit(6,0);
G_SensorPowerOnOff = 0;
// XBYTE[0x2038] &= 0xbf; //gpio6
}
#else
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
#endif
}
//-----------------------------------------------------------------------------
//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
//-------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -