⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 joetoevb.c

📁 台湾凌阳方案300万数码相机源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
		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-------------------------
					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
					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 (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
     {
		if (LB2)
		{
			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
//-----------------------------------------------------------------------------
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 - 5, height / 2 , UI_MENU_BG_COLOR_ON | UI_MENU_DEHIGHLIGHT_COLOR);



}


//=============================================================================
//UI_ShowMemoryFull
//=============================================================================
void UI_ShowMemoryFull(void) USING_0
	{
		 UCHAR width, height;
		UCHAR tmp;

	tmp = MemStretch;
	MemStretch = 0x01;
	XBYTE[0x2D18] &= 0x7f;
	MemStretch = tmp;

		 UI_GetFOSDSize(&width, &height);
		 UI_PrintOSDString(MEM_FULL[G_Language], (width / 2 - 5), (height / 2), UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_TITLE_TEXT_COLOR);

		//turnkey_patch2.2@ada@Memory full OSD begin
		G_usZoomOSDTimer = 5000;
		G_FlashStatus = K_FlashLightOff;//Davis:patch3.01
		UI_Buzzer();
		DELAY_100ms();
		UI_Buzzer();
		DELAY_100ms();
		UI_Buzzer();
		//turnkey_patch2.2@ada@Memory full OSD end
	}


//=============================================================================
//UI_GetOSDSize()
//=============================================================================
void UI_GetFOSDSize(PUCHAR FOSD_H_num, PUCHAR FOSD_V_num) USING_0
	{
		 if(G_DisplayType <= 7) //TV
		 {
			  *FOSD_H_num = (K_DISPLAY_StnLcdWidth/16)+5;
			  //Joe@2003.2.26 16:32 modify begin
			 *FOSD_V_num = (K_DISPLAY_StnLcdHeight/32);//wendy
			 // *FOSD_V_num = (G_DSPVsize/64);
			  //Joe@2003.2.26 16:32 modify end
		 }
		 else
		 {
			  *FOSD_H_num = (G_DSPHsize/16);
			  *FOSD_V_num = ((G_DSPVsize+4)/32);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -