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

📄 joetoevb.c

📁 dz3000_51.0.0.4.rar
💻 C
📖 第 1 页 / 共 5 页
字号:

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

		while ((XBYTE[0x2040] & 0x04) > 0);
		//DbgPrint("L2_TurnOnOffDisplay4=%bu\n",4);
		L2_TurnOnOffDisplay(0);
		L2_SetGPIOBit(14,1);     //Power off	//Davis:patch5.0.0.5_2005/Jul/19
		while(1);
     }
#endif

#if (K_BATT_SEG_TOTAL == 3)
     if ((G_HighPowerCount == 0) && (G_BatteryStatus == K_BATTERY_STATUS_MID))
     {
	G_BatteryStatus = K_BATTERY_STATUS_HIGH;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_HighPowerCount >= 50) && (G_BatteryStatus == K_BATTERY_STATUS_HIGH)) //2 sec
     {
	G_BatteryStatus = K_BATTERY_STATUS_MID;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_MidPowerCount == 0) && (G_BatteryStatus == K_BATTERY_STATUS_LOW))
     {
	G_BatteryStatus = K_BATTERY_STATUS_MID;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_MidPowerCount >= 50) && (G_BatteryStatus == K_BATTERY_STATUS_MID)) //2 sec
     {
	G_BatteryStatus = K_BATTERY_STATUS_LOW;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_LowPowerCount == 0) && (G_BatteryStatus == K_BATTERY_STATUS_EMPTY))
     {
	G_BatteryStatus = K_BATTERY_STATUS_LOW;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_LowPowerCount >= 50) && (G_BatteryStatus == K_BATTERY_STATUS_LOW))	//2 sec
     {
	G_BatteryStatus = K_BATTERY_STATUS_EMPTY;

	status = G_UIStatus & 0xff00;

	if (status == K_UISTATUS_DSC_PREVIEW)
     	{
          	UI_PreviewStatusOSD();
	}
	else
	{
		UI_PlaybackStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_LowPowerCount >= 300) && (G_BatteryStatus == K_BATTERY_STATUS_EMPTY) && (G_FlashCharging == 0))	//Power off after low power signal is kept detected for 30 sec
     {
	UI_Save_NAND_UiParameters();
	UI_ShowLowBattery();
	L2_TurnOnOffDisplay(1);

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

	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_SetGPIOBit(14,1);     //Power off	//Davis:patch5.0.0.5_2005/Jul/19
	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 = 140;
		 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,1);	   //Power off	//Davis:patch5.0.0.5_2005/Jul/19
		  //	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);
                              #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);
                              #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++)

⌨️ 快捷键说明

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