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

📄 joetoevb.c

📁 台湾凌阳方案300万数码相机源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
	DELAY_1s();
	UI_ClearFOSD(25,8,0x00);

	UI_ShowGoodBye();

	DELAY_1s();
	UI_Buzzer();
	DELAY_100ms();

	while ((XBYTE[0x2040] & 0x04) > 0);
	//DbgPrint("L2_TurnOnOffDisplay5=%bu\n",5);
	L2_TurnOnOffDisplay(0);
		L2_CtrlScreen(1);//wendy@2004/9/8
	UI_ClearFOSD(25, 8, 0x08);
	L2_SetGPIOBit(14,0);     //Power off
	while(1);
     }
#endif
}

//=============================================================================
//UI_AutoPowerOffDetect
//=============================================================================
void UI_AutoPowerOffDetect(void) USING_0
#if 0
{
	//	UCHAR FOSD_H_num, FOSD_V_num;
	//	UI_GetFOSDSize(&FOSD_H_num, &FOSD_V_num);
		G_AutoTimeInSec = 60;


		 if ((G_AutoPowerOffCount>=G_AutoTimeInSec)&&(G_CameraOptions.Timeout==1)&&(G_UI_USBConnect == K_UI_USB_DISCONNECT))	//0.1 sec unit//wendy
		 {

		 if (G_AutoPowerOffCount>=G_AutoTimeInSec)
		 {
			 UI_FlashLight_Power(0);

	//		 UI_PrintOSDNumber((SHORT)G_ucDataBuffer[28], 3, 4, 4);
	//		  DELAY_100ms();//wendy@2004/9/
			  UI_ShowGoodBye();
//    UI_PrintOSDNumber(G_AutoPowerOffCount, 2,1, 4);
//    UI_PrintOSDNumber(G_AutoTimeInSec, 2,4,4);

			UI_Save_NAND_UiParameters();
		//	UI_PrintOSDNumber((SHORT)G_Language, 3, 2, 4);
		//	UI_PrintOSDNumber((SHORT)G_ucDataBuffer[28], 3, 3, 4);


			  UI_Buzzer();
			DELAY_100ms();
			DELAY_100ms();
			  UI_Buzzer();

//			  L2_TurnOnOffDisplay(1);
			DELAY_1s();
			L2_TurnOnOffDisplay(0);
//			L2_SetGPIOBit(15,0);  //wendy@2004/9/8//TFT power
					//DbgPrint("L2_TurnOnOffDisplay1=%bu\n",1);
			DELAY_100ms();

//			L2_SetGPIOBit(16,0);  //wendy@2004/9/8//TFT power

			  L2_SetGPIOBit(14,0);	   //Power off
		  	while(1);
		 }
		 	}

	}
#else
{
	//	UCHAR FOSD_H_num, FOSD_V_num;
	//	UI_GetFOSDSize(&FOSD_H_num, &FOSD_V_num);
G_AutoTimeInSec = 145;
		 if ((G_AutoPowerOffCount>=G_AutoTimeInSec)&&(G_CameraOptions.Timeout==1)&&(G_UI_USBConnect == K_UI_USB_DISCONNECT))	//0.1 sec unit//wendy
		 {

		 if (G_AutoPowerOffCount>=G_AutoTimeInSec)
		 {
			 UI_FlashLight_Power(0);

	//		 UI_PrintOSDNumber((SHORT)G_ucDataBuffer[28], 3, 4, 4);
	//		  DELAY_100ms();//wendy@2004/9/
			  UI_ShowGoodBye();
//    UI_PrintOSDNumber(G_AutoPowerOffCount, 2,1, 4);
//    UI_PrintOSDNumber(G_AutoTimeInSec, 2,4,4);

			UI_Save_NAND_UiParameters();
		//	UI_PrintOSDNumber((SHORT)G_Language, 3, 2, 4);
		//	UI_PrintOSDNumber((SHORT)G_ucDataBuffer[28], 3, 3, 4);


			  UI_Buzzer();
			DELAY_100ms();
			DELAY_100ms();
			  UI_Buzzer();

//			  L2_TurnOnOffDisplay(1);
			DELAY_1s();
			L2_TurnOnOffDisplay(0);
//			L2_SetGPIOBit(15,0);  //wendy@2004/9/8//TFT power
					//DbgPrint("L2_TurnOnOffDisplay1=%bu\n",1);
						L2_CtrlScreen(1);//wendy@2004/9/8
	UI_ClearFOSD(25, 8, 0x08);
			DELAY_100ms();

			L2_SetGPIOBit(16,0);  //wendy@2004/9/8//TFT power

			  L2_SetGPIOBit(14,0);	   //Power off
		  //	while(1);
		  UI_CardPowerOnOff(0);

		  L2_Suspend_UI(0);
		  G_AutoPowerOffCount=0;
		  L2_Resume_UI();
		 }
		 	}

	}
#endif
//=============================================================================
//UI_TVOutDetect
//=============================================================================
void UI_TVOutDetect(void) USING_0
	{
	 UCHAR tmp;
     #if(TURNKEY_OPTION == 1)
		 if (VIDEO_DET == 1)//wendy@2004/8/30	//Davis@2004/9/2 VIDEO_DET == 1
     #else
		 if ((XBYTE[0x2040] & 0x01) == 0)
     #endif
		 {
 			if ((G_DisplayType != K_DISPLAY_CompTvNtsc) && (G_DisplayType != K_DISPLAY_CompTvPal))
			{
				 if (G_CameraOptions.TVDispType == K_UIOPTION_TVTYPE_NTSC)
				 {

						ChangeDispDevice(K_DISPLAY_CompTvNtsc);
						if((G_UIStatusH&0xff00)==K_UISTATUS_DSC_PLAY)
						{
						UI_DestroyMenu();	//wendy@2004/8/15
						Playback_Initial();
						}
						else
						UI_DestroyMenu();	//wendy@2004/8/15
				 }
				 else if (G_CameraOptions.TVDispType == K_UIOPTION_TVTYPE_PAL)
				 {
				//	 if((G_UIStatusH&0x00ff)!=0)
						ChangeDispDevice(K_DISPLAY_CompTvPal);
				if((G_UIStatusH&0xff00)==K_UISTATUS_DSC_PLAY)
					{
					UI_DestroyMenu();	//wendy@2004/8/15
					Playback_Initial();
					}
				else
				UI_DestroyMenu();	//wendy@2004/8/15
				            }

				 G_AutoPowerOffCount = 0;
			  }
		 }
		 else
		 {
			  if ((G_DisplayType == K_DISPLAY_CompTvNtsc) || (G_DisplayType == K_DISPLAY_CompTvPal))
			  {
                        //patch4.3@yichang@0611 for version B/C chip co-exist
                              tmp = MemStretch;
                              MemStretch = 0x01;

                              //patch4.1@yichang@0517 for TV out -> LCD
                              XBYTE[0x2D32] = 0x20;		// osdvzfac
                              MemStretch = tmp;

                              #ifdef STNLCD
                              ChangeDispDevice(K_DISPLAY_StnLcd);
                              #endif

                              #ifdef UPS051
                              ChangeDispDevice(K_DISPLAY_Ups051);
                              #endif

                              #ifdef AU015AN02

                              ChangeDispDevice(K_DISPLAY_Au015An02);
				if((G_UIStatusH&0xff00)==K_UISTATUS_DSC_AUDIO)
				  {
				  UI_PrintPic();
				  }
                              #endif

                              #ifdef EPSON
                              ChangeDispDevice(K_DISPLAY_Epson);
                              #endif

                              #ifdef CASIO
                              ChangeDispDevice(K_DISPLAY_Casio);
                              #endif

                              #ifdef STNLCD160
                              ChangeDispDevice(K_DISPLAY_StnLcd160);
                              #endif

                              #ifdef VGATFT
                              ChangeDispDevice(K_DISPLAY_VgaTftLcd);
                              #endif

                              #ifdef SVGAOUT
                              ChangeDispDevice(K_DISPLAY_Svga);
                              #endif

                              #ifdef AU015BL01	//patch5.2.1@cwh@AU015BL01;2003/08/08
                              ChangeDispDevice(K_DISPLAY_Au015Bl01);
                              #endif

                              #ifdef TOPPOLY		//patch5.2.1@cwh@Toppoly TC015TREB1;2003/08/27
                              ChangeDispDevice(K_DISPLAY_Tc015Treb1);
                              #endif

                              // patch 5.2.1_28@mattwang@rename CASIO2G to CASIO2G1181 beg
                              #ifdef CASIO2G1181		//patch5.2.1@cwh@CASIO2G ;2003/09/24
                              ChangeDispDevice(K_DISPLAY_Casio2G1181);
                              #endif
                              // patch 5.2.1_28@mattwang@rename CASIO2G to CASIO2G1181 end

                              // patch 5.2.1_28@mattwang@add CASIO2G1163 LCD pannel beg
                              #ifdef CASIO2G1163
                              ChangeDispDevice(K_DISPLAY_Casio2G1163);
                              #endif
                              // patch 5.2.1_28@mattwang@add CASIO2G1163 LCD pannel end

                              // patch 5.2.1_30@mattwang@add STNLCD128 LCD pannel beg
                              #ifdef STNLCD128
                              ChangeDispDevice(K_DISPLAY_StnLcd128);
                              #endif
                              // patch 5.2.1_30@mattwang@add STNLCD128 LCD pannel end

                              // patch 5.2.1_33@mattwang@add AU015AN04 LCD pannel beg
                              #ifdef AU015AN04


                              ChangeDispDevice(K_DISPLAY_Au015An04);
				if((G_UIStatusH&0xff00)==K_UISTATUS_DSC_AUDIO)
				  {
				  UI_PrintPic();
				 // Playback_Initial();
				  }
                              #endif
                              // patch 5.2.1_33@mattwang@add AU015AN04 LCD pannel end

				  if((G_UIStatusH&0xff00)==K_UISTATUS_DSC_PLAY)
				  {
				  UI_DestroyMenu();   //wendy@2004/8/15
				 // Playback_Initial();
				  }
				  else
				  UI_DestroyMenu();   //wendy@2004/8/15
				
                         }
			  
		 }

	}

//=============================================================================
//UI_CardHotInsertionDetect
//=============================================================================
void UI_CardHotInsertionDetect(void) USING_0
{
     USHORT status;
     UCHAR sts;

     L2_CardDetect(&sts);
     if ( ((sts == FALSE) && (G_ExtCardStatus == 1)) \
     	|| ((sts == TRUE) && (G_ExtCardStatus == 0)) )
     {
          G_AutoPowerOffCount = 0;

	  //turnkey_patch2.2@ada@Cancel the menu while switching storage begin
	  if (G_CameraOptions.DPOF == K_UIOPTION_DPOF_ON)
	  {
		G_CameraOptions.DPOF = K_UIOPTION_DPOF_OFF;
	  }

	  if (G_StayInMenu)
	  {
		//turnkey_patch2.2@ada@Fix the bug which can not jump out of the charging loop while power low begin
		G_FlashChargingCount = 0;
		//turnkey_patch2.2@ada@Fix the bug which can not jump out of the charging loop while power low end

		//turnkey_patch2.2@ada@Cancel the menu if non key is pressed after time out begin
		G_StayInMenuCount = 0;
		//turnkey_patch2.2@ada@Cancel the menu if non key is pressed after time out end

		//turnkey_patch2.2@ada@Cancel the DPOF function if USB is plugged in begin
		if (G_CameraOptions.DPOF == K_UIOPTION_DPOF_ON)
		{
			G_CameraOptions.DPOF = K_UIOPTION_DPOF_OFF;
		}
		//turnkey_patch2.2@ada@Cancel the DPOF function if USB is plugged in end
			UI_DestroyMenu();
	  }
	  //turnkey_patch2.2@ada@Cancel the menu while switching storage end
          UI_BusyLed(1);
          UI_Buzzer();
          INITIO_StorageInitialize();


          status = G_UIStatus & 0xff00;

          if (status == K_UISTATUS_DSC_PREVIEW)
          {
               UI_PreviewStatusOSD();
          }
          else
          {
               if (status == K_UISTATUS_DSC_PLAY)
               {
               	    if (G_UI_USBConnect == K_UI_USB_DISCONNECT)
               	    {
	//						DELAY_1s();//bug//wendy@2004/4/20
							//DELAY_1s();//bug//wendy@2004/4/20


			Playback_Initial(); //Note:This function maybe change G_ExtCardStatus
		    }
               	    else
               	    {
			Playback_Initial(); //Note:This function maybe change G_ExtCardStatus//wendy@2004/4/20
	//UI_PlaybackStatusOSD();
		    }
               }
             if(status == K_UISTATUS_USBMODE_MASS)

		UI_PrintOSDString("  MSDC ", 6, 3, UI_MENU_BG_COLOR_ON | UI_MENU_TITLE_TEXT_COLOR); 				 ////printf("MSDC\n");



          	}

          UI_BusyLed(0);
          G_AutoPowerOffCount = 0;
          #if (MLUN_OPTION)
	        if((G_UIStatus & 0xff00) ==K_UISTATUS_USBMODE_MASS)
		   MLUN_Initialize();
	  #endif
     }
}


//=============================================================================
//UI_Buzzer
//=============================================================================
void UI_Buzzer(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;*/
	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
     {

⌨️ 快捷键说明

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