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

📄 vfd_portable.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 2 页
字号:
/*
----->included by vfd_io_util.c
----->only for portable dvd use.
----->did it on 07/25
*/

#ifdef EASTWIN
extern UINT8  safe_on;
#endif

#ifdef EASTWIN
void check_portable_gpio(void)
{
    UINT16 temp=0;
    
    #ifdef TFT_VIDEO_INOUT
    static BYTE AVin_step = 0;
    
    INT_EXT_GPIO_INIT();
   
    switch (GPIO_I_GET(INT_EXT_VIDEO_GPIO))
    {
      case 0://8210 input video to TFT
        if((system_state == SYSTEM_OPEN) && (AVin_step == 1))
        {//just now system was interrupted in reading disc 
              if(CDOpened())
              {
                call_ir_func(IRC_EJECT);
                AVin_step = 0;
                //printf("i am going to read disc.......\n");
              }
        }
        else if((system_state == SYSTEM_STOP) && (AVin_step == 2))
        {//just now system was interrupted in normal playing state
                ircmd_play();
                AVin_step = 0;
                //printf("i am going to play disc.......\n");
        }
        
        if(hold_state == 2)
          hold_state = 0;
          
      break;
      case 1://External AV input to TFT
        if(system_state == SYSTEM_READ_TITLE)
        {//in reading disc and 
            if(!CDOpened())
            {
              AVin_step = 1;
              call_ir_func(IRC_EJECT);
              //printf("video in when reading disc,then i go into open state\n");
            } 
            
        }
        else if(system_state == SYSTEM_BROWSE)
        {
            if(play_state != VCD_STATE_STOP)
            {
                AVin_step = 2;
                ircmd_stop();
                #ifdef STOP_LOADER
                stop_loader();
                #endif
                //printf("video in when playing disc,then i go into stop state\n");
            }
        } 
        
        if(hold_state == 0)
          hold_state = 2;       
      
      break;
      
    }
    
    if(!AVin_step)
    {
    #endif //end #ifdef TFT_VIDEO_INOUT
    
    #ifdef SUNPLUS_8202P_DEMOBOARD
    regs0->sft_cfg4 &= ~((0x03)<<2);    //Enable GPIO2,3 For COVER & TFT SW
    #endif
    
    #ifdef TFT_VIDEO_INOUT
    }
    #endif //end #ifdef TFT_VIDEO_INOUT

    #ifdef TFT_VIDEO_INOUT 
    if(!AVin_step)
    {
    #endif //end #ifdef TFT_VIDEO_INOUT 
    #ifdef HOLD_KEY_DETECT    
    temp=regs0->gpio_in[HOLD_GPIO / 16] & (1 << (HOLD_GPIO % 16));  //get gpio37(HOLD)
    if(temp)
        hold_state=1;
    else
        hold_state=0;           
    #endif
    
    temp=regs0->gpio_in[TFT_SW_GPIO / 16] & (1 << (TFT_SW_GPIO % 16));  //get gpio44(TFT_SW)

    if(temp)						// lcd panel open
    {
    	if(!bINVERTER_POWER)
    	{
    		INVERTER_POWER_ON();			
    		bINVERTER_POWER = 1;
    		bPOWER_LED_FLASH = 0;
    	}		
    }
    else									// lcd panel close
    {
    	if(bINVERTER_POWER)
    	{
    		INVERTER_POWER_OFF();			
    		bINVERTER_POWER = 0;
    		bPOWER_LED_FLASH = 1;
    	}   	
    }
    
    if(bINVERTER_POWER)						// lcd panel open
    {
		if(!bAMP_IS_ON && bPOWER_ON_MUTE_EXE)
		{
    		ENABLE_AMP();
    		bAMP_IS_ON = 1;
    	}
    }
    else									// lcd panel close
    {
		if(EAR_DETECT())			// earphone no plug in 
    	{
    		if(bAMP_IS_ON)
			{
    			DISABLE_AMP();
    			bAMP_IS_ON = 0;
    		}
    	} 
    	else						// earphone plug in 
    	{	if(!bAMP_IS_ON && bPOWER_ON_MUTE_EXE)
			{
    			ENABLE_AMP();
    			bAMP_IS_ON = 1;
    		}							
    	} 
    }
    
    #ifdef POWER_ON_MUTE
    if(!bPOWER_ON_MUTE_EXE)
    {
    	if(power_on_mute_timer >100 )	// power on to mute off time around 4.5S 
    	{
    		AUDIO_MUTE_OFF();
    		bPOWER_ON_MUTE_EXE = 1;
    		power_on_mute_timer = 0;
    	}
    	power_on_mute_timer++;
    }
    #endif    
    
    #ifdef POWER_LED_FLASH
    if(bPOWER_LED_FLASH)
    {
    	if( power_led_flash_timer < 100 )
    	{
    		power_led_flash_timer ++;
    		POWER_LED_ON();	   	
    	}    	
    	else
    	{
    		if((power_led_flash_timer>=100) & (power_led_flash_timer<=200))
            {
    			power_led_flash_timer ++;    		
    			POWER_LED_OFF();
    		}
    		else
    		    power_led_flash_timer = 0;
    	}	
    }
    else
    {
    	power_led_flash_timer = 0;
    	POWER_LED_OFF();
    }  
    #endif // end of POWER_LED_FLASH
      
    
    #ifdef TFT_VIDEO_INOUT
    }
    #endif //end #ifdef TFT_VIDEO_INOUT
        
    // Eastwin change to GPIO 18
    temp = regs0->gpio_in[LOWBAT_DET_GPIO / 16] & (1 << (LOWBAT_DET_GPIO % 16));
    if(!temp)	  
    {   
        bIS_LOWBAT = 0;			// Kevin Sep 10,04 
        if(bLOWBAT_DISP)
        {
        	bLOWBAT_DISP = 0;
        	ClearOsdMsg(2);
        	lowbat_timer=0;
        } 
    }
    else
    {
        bIS_LOWBAT = 1;			// Kevin Sep 10,04 		
        if (safe_on==1)			// Kevin Sep 10,04 
        	safe_srn_off();
        if(lowbat_timer<100)
        {
            PrintOsdMsg(STR_OS_LOWBAT,REGION2,0,0);
            lowbat_timer++;
            bLOWBAT_DISP = 1;
        }   
        else
        {
            if((lowbat_timer>=100) & (lowbat_timer<150))
            {
                ClearOsdMsg(2);
                lowbat_timer++;
                bLOWBAT_DISP = 0;
            }   
            else
            {    
                lowbat_timer = 0;
                bLOWBAT_DISP = 1;
            }
        }   
    }   
}

#else

void check_portable_gpio(void)
{
	UINT16 temp=0;
	
    #ifdef TFT_VIDEO_INOUT
    static BYTE AVin_step = 0;
    
    INT_EXT_GPIO_INIT();
   
    switch (GPIO_I_GET(INT_EXT_VIDEO_GPIO))
    {
    case 0://8210 input video to TFT
        if((system_state == SYSTEM_OPEN) && (AVin_step == 1))
        {//just now system was interrupted in reading disc 
              if(CDOpened())
              {
                call_ir_func(IRC_EJECT);
                AVin_step = 0;
                //printf("i am going to read disc.......\n");
              }
        }
        else if((system_state == SYSTEM_STOP) && (AVin_step == 2))
        {//just now system was interrupted in normal playing state
                ircmd_play();
                AVin_step = 0;
                //printf("i am going to play disc.......\n");
        }
        
        if(hold_state == 2)
            hold_state = 0;
          
        break;
    case 1://External AV input to TFT
        if(system_state == SYSTEM_READ_TITLE)
        {//in reading disc and 
            if(!CDOpened())
            {
              AVin_step = 1;
              call_ir_func(IRC_EJECT);
              //printf("video in when reading disc,then i go into open state\n");
            } 
            
        }
        else if(system_state == SYSTEM_BROWSE)
        {
            if(play_state != VCD_STATE_STOP)
            {
                AVin_step = 2;

⌨️ 快捷键说明

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