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

📄 joetoevb.c

📁 dz3000_51.0.0.4.rar
💻 C
📖 第 1 页 / 共 5 页
字号:
          XBYTE[0x201a] &= 0x07; // P1 is used for GPIO
     }
     else
     {
          XBYTE[0x201a] |= 0x10; // P1 is used for low byte address
     }
}
/*
//=============================================================================
//UI_Get_FOUCS
//=============================================================================
void UI_Get_FOUCS (void) USING_0
{
if(FOCUS_DET)
	
 {
//DELAY_1s();


if (FOCUS_DET)
{ 
if (L_KFOCUS!=1)
   { 
   L_KFOCUS=1;
   }
}
}
else
 {
 if (L_KFOCUS!=0)
   { 
 L_KFOCUS=0;
}


}
}
*/
//=============================================================================
//UI_PowerOnOffDetect
//=============================================================================
/*	//Davis:patch3.11  close
//Davis:patch2.0  add
#define POWON 1		//modify for debug 0->1
#define POWOFF 0	//modify for debug 1->0
void UI_PowerOnOffDetect(UCHAR OnOff) USING_0
{
     UCHAR i;
     #if(TURNKEY_OPTION == 1)
	if (OnOff)
	{
		if (PWR_DET == POWON)
		{
			DELAY_1s();

			if (PWR_DET == POWON)
			{
				L2_SetGPIOBit(14,1);     //Go on the following program
				G_KeepPressPowerOn = 1;
			}
		}
	}
	else
	{
		if (G_KeepPressPowerOn)
		{
          		if (PWR_DET == POWOFF)
			{
				DELAY_100ms();

	          		if (PWR_DET == POWOFF)
				{
					G_KeepPressPowerOn = 0;
				}
			}
		}

		if (G_KeepPressPowerOn == 0)
		{		
		
			if (PWR_DET == POWON)
			{
				for (i = 0; i < 5; i++)
				{
					DELAY_100ms();
				}

				if (PWR_DET == POWON)
				{
					UI_ShowGoodBye();
					

					UI_Save_NAND_UiParameters();

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

					L2_TurnOnOffDisplay(1);
					DELAY_1s();
					L2_TurnOnOffDisplay(0);
					//DbgPrint("L2_TurnOnOffDisplay1=%bu\n",1);
//					L2_SetGPIOBit(16,0);  //wendy@2004/9/8//TFT power
					L2_ConfigGPIOBit(14,1);
					while (PWR_DET == POWON);

					L2_SetGPIOBit(14,0);     //Power off

					while(1);
				}
			}
		}
	}
     #else
     //Joe@2003.2.25 14:56 add begin
     L2_ConfigGPIOBit(14,1);
     L2_ConfigGPIOBit(2,0);
     //Joe@2003.2.25 14:56 add end

     if (OnOff)
     {
          if ((XBYTE[0x2040] & 0x04) > 0)
          {
               DELAY_1s();

               if ((XBYTE[0x2040] & 0x04) > 0)
               {
                    L2_SetGPIOBit(14,1);     //Go on the following program

		    G_KeepPressPowerOn = 1;
               }
          }
     }
     else
     {
	  if (G_KeepPressPowerOn)
	  {
          	if ((XBYTE[0x2040] & 0x04) == 0)
		{
			DELAY_100ms();

	          	if ((XBYTE[0x2040] & 0x04) == 0)
			{
				G_KeepPressPowerOn = 0;
			}
		}
	  }

	  if (G_KeepPressPowerOn == 0)
	  {
		if ((XBYTE[0x2040] & 0x04) > 0)
		{
          	     for (i = 0; i < 5; i++)
               	     {
			  DELAY_100ms();
	             }

		     if ((XBYTE[0x2040] & 0x04) > 0)
		     {
          	          UI_ShowGoodBye();
			  UI_Save_NAND_UiParameters();//Davis@2004/8/31

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

			  L2_TurnOnOffDisplay(1);
			  DELAY_1s();

	                  while ((XBYTE[0x2040] & 0x04) > 0);
			  //DbgPrint("L2_TurnOnOffDisplay2=%bu\n",2);
	                  L2_TurnOnOffDisplay(0);
	                  L2_SetGPIOBit(14,0);     //Power off

	                  while(1);
     	             }
                }
	  }
     }
     #endif
}
//*/
//Davis:patch3.11 open begin=======================================================
//*	
void UI_PowerOnOffDetect(UCHAR OnOff) USING_0
{
		 UCHAR i;
	
     #if(TURNKEY_OPTION == 1)
		if (OnOff)
		{
			if (PWR_DET == 0)//Davis:patch5.0.0.5_2005/Jul/19
			{
			//wendy@2004/9/20
			DELAY_100ms();
			DELAY_100ms();
//			DELAY_100ms();
//			DELAY_100ms();
			//wendy@2004/9/20
				if(PWR_DET == 0)
				{
				//Davis:patch5.0.0.5_2005/Jul/19	L2_SetGPIOBit(14,1);	 //Go on the following program
 				}
			}
		}
		else
		{
				//Davis:patch5.0.0.5_2005/Jul/19	检测到PWR_DET高则关机
			   if (PWR_DET == 1)
			   {
					//wendy@2004/9/20
//05.3.8				DELAY_100ms();
//05.3.8					DELAY_100ms();
//					DELAY_100ms();
//					DELAY_100ms();
				if (PWR_DET == 1)
				{	//wendy@2004/9/20
						UI_FlashLight_Power(0);
						UI_ShowGoodBye();
						UI_Save_NAND_UiParameters();
	
						UI_Buzzer();
						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_ConfigGPIOBit(14,1);
	
						L2_SetGPIOBit(14,1);	 //Power off	//Davis:patch5.0.0.5_2005/Jul/19
	
						while(1);
						}
				}
		}
			
		
     #else
		 //Joe@2003.2.25 14:56 add begin
		 L2_ConfigGPIOBit(14,1);
		 L2_ConfigGPIOBit(2,0);
		 //Joe@2003.2.25 14:56 add end
	
		 if (OnOff)
		 {
			  if ((XBYTE[0x2040] & 0x04) > 0)
			  {
				   DELAY_1s();
	
				   if ((XBYTE[0x2040] & 0x04) > 0)
				   {
						L2_SetGPIOBit(14,1);	 //Go on the following program
	
				G_KeepPressPowerOn = 1;
				   }
			  }
		 }
		 else
		 {
		  if (G_KeepPressPowerOn)
		  {
				if ((XBYTE[0x2040] & 0x04) == 0)
			{
				DELAY_100ms();
	
					if ((XBYTE[0x2040] & 0x04) == 0)
				{
					G_KeepPressPowerOn = 0;
				}
			}
		  }
	
		  if (G_KeepPressPowerOn == 0)
		  {
			if ((XBYTE[0x2040] & 0x04) > 0)
			{
					 for (i = 0; i < 5; i++)
						 {
				  DELAY_100ms();
					 }
	
				 if ((XBYTE[0x2040] & 0x04) > 0)
				 {
						  UI_ShowGoodBye();
				  UI_Save_NAND_UiParameters();
	
						  UI_Buzzer();
				  DELAY_100ms();
				  DELAY_100ms();
				  UI_Buzzer();
	
				  L2_TurnOnOffDisplay(1);
				  DELAY_1s();
	
						  while ((XBYTE[0x2040] & 0x04) > 0);
				  //DbgPrint("L2_TurnOnOffDisplay2=%bu\n",2);
						  L2_TurnOnOffDisplay(0);
						  L2_SetGPIOBit(14,0);	   //Power off
	
						  while(1);
						 }
					}
		  }
		 }
     #endif
	}
//*/
//Davis:patch2.0 close end=======================================================

//=============================================================================
//UI_LowPowerDetect
//=============================================================================
void UI_LowPowerDetect(void) USING_0
{
     USHORT status;
     UCHAR FOSD_H_num, FOSD_V_num;
     UI_GetFOSDSize(&FOSD_H_num, &FOSD_V_num);	 	
#if (K_BATT_SEG_TOTAL == 1)
     if ((G_LowPowerCount == 0) && (G_BatteryStatus == K_BATTERY_STATUS_EMPTY))
     {
	G_BatteryStatus = K_BATTERY_STATUS_HIGH;

	status = G_UIStatus & 0xff00;

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

        UI_Buzzer();
     }

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

	status = G_UIStatus & 0xff00;
	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
	L2_TurnOnOffDisplay (1);  //debug
						//wendy@2004/9/9
	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);
	if (status == K_UISTATUS_DSC_PLAY)
     	{
          UI_PlaybackStatusOSD();
	}
	else
	{
	UI_PreviewStatusOSD();
	}

        UI_Buzzer();
     }

     if ((G_LowPowerCount >= 80) && (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);  //debug
//	L2_SetGPIOBit(15,1);  //wendy@2004/9/8//TFT power
	UI_FlashLight_Power(0);

	UI_Buzzer();
	DELAY_100ms();
	UI_Buzzer();
	DELAY_100ms();
	DELAY_100ms();
	UI_Buzzer();
	DELAY_100ms();
	DELAY_100ms();
	UI_ClearFOSD(25,8,0x00);	

	UI_ShowGoodBye();
	DELAY_100ms();
	DELAY_1s();
	UI_Buzzer();
	DELAY_100ms();
	DELAY_100ms();
	L2_ConfigGPIOBit(14,1);
	L2_SetGPIOBit(16,0);  //wendy@2004/9/8//TFT power	//add for debug	
	L2_TurnOnOffDisplay (0);  //debug
	L2_SetGPIOBit(14,1);     //Power off	//Davis:patch5.0.0.5_2005/Jul/19
	  UI_CardPowerOnOff(0);//add for debug
	 L2_Suspend_UI(0);
	 G_AutoPowerOffCount=0;
	 L2_Resume_UI();
	 //wendy@2004/9/8

     }
#endif

#if (K_BATT_SEG_TOTAL == 2)
     if ((G_MidPowerCount == 0) && (G_BatteryStatus == K_BATTERY_STATUS_LOW)){
		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_MidPowerCount >= 50) && (G_BatteryStatus == K_BATTERY_STATUS_HIGH)) //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 >= 100) && (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();

⌨️ 快捷键说明

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