📄 ircmd_switch_media.c
字号:
/****************************************************************************************\
** Function Name : ircmd_key_disc **
** Purposes : Switch to play disc. **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
#ifndef NO_DVD_SERVO
void ircmd_key_disc(void)
{
//printf("\n======================> TO DISC <======================\n");
if (media_status == STATUS_DISC)
{
psprintf(RegionValStr[REGION1], "[DISC MODE]");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
#ifdef SDRAM_16Mb_Mode //winking.J add for return play 2007-1-11 10:41
ircmd_resume();
#endif
#ifdef SUPPORT_FILEKOK //xg.qi add 20070807
extern BYTE g_scIsMp4Karaoke;
extern void FileKok_ReShow(void);
if (g_scIsMp4Karaoke)
FileKok_ReShow();
#endif
return;
}
switch_2_des_media(DES_DISC);
}
#endif//NO_DVD_SERVO
/****************************************************************************************\
** Function Name : ircmd_key_usb **
** Purposes : Switch to play USB device. **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
#ifdef SUPPORT_USB
void ircmd_key_usb(void)
{
//printf("\n======================> TO USB <======================\n");
if (media_status == STATUS_USB)
{
psprintf(RegionValStr[REGION1], "[USB MODE]");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
#ifdef SDRAM_16Mb_Mode //winking.J add for return play 2007-1-11 10:41
ircmd_play();
#endif
return;
}
switch_2_des_media( DES_USB );
}
#endif//SUPPORT_USB
/****************************************************************************************\
** Function Name : ircmd_key_card **
** Purposes : Switch to play CARD device. **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
#ifdef SPHE8202_CARD_STORAGE
void ircmd_key_card(void)
{
//printf("\n======================> TO CARD <======================\n");
if (media_status == STATUS_CARD)
{
psprintf(RegionValStr[REGION1], "[CARD MODE]");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
#ifdef SDRAM_16Mb_Mode //winking.J add for return play 2007-1-11 10:41
ircmd_play();
#endif
return;
}
switch_2_des_media(DES_CARD);
}
#endif//SPHE8202_CARD_STORAGE
/****************************************************************************************\
** Function Name : check_media_switch **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
void check_media_switch(void)
{
#ifdef SUPPORT_USB
if(media_status == STATUS_USB)
{
#if defined(SPHE8202_CARD_STORAGE)&& defined(CARD_SETUP_TYPE_ONLY_1SENSE_PIN)
sd_ms_card_flag = 1; // clear for usb to ms,aerliqu,2007-8-8;
#endif
#ifndef NO_DVD_SERVO
if(atapi_p_mechanism_status() != ATAPI_DOOR_OPEN)
#endif
{
if (is_usb_media_exists())
{
usb_test_ready();
}
else //zhongshan added for no usb 2007-5-7 08:30PM
{
psprintf(RegionValStr[ REGION1 ], "[NO USB]");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
}
}
#endif//SUPPORT_USB
#ifdef SPHE8202_CARD_STORAGE
if ((media_status == STATUS_CARD)
#ifndef NO_DVD_SERVO
&& (atapi_p_mechanism_status() != ATAPI_DOOR_OPEN)
#endif//NO_DVD_SERVO
)
{
#ifdef CARD_SETUP_TYPE_3
if (polling_card_conflict())
detect_type = 0;
#endif//CARD_SETUP_TYPE_3
if (is_card_media_exists())
{
card_test_ready();
}
else //zhongshan for no card 2007-5-7 08:29PM
{
#ifdef CARD_SETUP_TYPE_ONLY_1SENSE_PIN
sd_ms_card_flag = 1; // clear for no card to ms,aerliqu,2007-8-8;
#endif
psprintf(RegionValStr[ REGION1 ], "[NO CARD]");
PrintOsdMsg(STR_OS_SPACE, REGION1, 1, 1);
}
}
#endif//SPHE8202_CARD_STORAGE
}
/****************************************************************************************\
** Function Name : polling_card_conflict **
** Purposes : detect if cards inserted more than two types. **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
#if (defined(CARD_SETUP_TYPE_3) && defined(SPHE8202_CARD_STORAGE))//added by wangwei,2005-11-15 14:30
int polling_card_conflict(void)
{
// Warning message, only support one card insert.
// A problem is that system can not judge the situation that Xd & SMC insert at the same time.
if(((detect_type & CF_CARD_DEVICE) && (detect_type & SD_CARD_DEVICE)) // CF & SD
|| ((detect_type & CF_CARD_DEVICE) && (detect_type & MS_CARD_DEVICE)) // CF & MS
|| ((detect_type & CF_CARD_DEVICE) && (detect_type & SMC_CARD_DEVICE)) // CF & SMC
|| ((detect_type & SD_CARD_DEVICE) && (detect_type & SMC_CARD_DEVICE)) // SD & SMC
|| ((detect_type & MS_CARD_DEVICE) && (detect_type & SMC_CARD_DEVICE)) // MS & SMC
|| ((detect_type & CF_CARD_DEVICE) && (detect_type & SMC_CARD_DEVICE) && (detect_type & SD_CARD_DEVICE)) // CF & SMC & SD
|| ((detect_type & CF_CARD_DEVICE) && (detect_type & SMC_CARD_DEVICE) && (detect_type & SD_CARD_DEVICE))) // CF & SMC & MS
{
if(iIsCardConflict == 0)
{
iIsCardConflict = 1;
psprintf(RegionValStr[REGION1], "PLEASE INSERT ONE CARD ONLY");
PrintOsdMsg(STR_OS_SPACE, REGION1, 0, 1);
// If CARD storage is playing, stop it.
if ((storage_type == CF_CARD_DEVICE)
|| (storage_type == SD_CARD_DEVICE)
|| (storage_type == MS_CARD_DEVICE)
|| (storage_type == SMC_CARD_DEVICE))
{
AVD_SetMediaInterrupt();
storage_type = 0;
media_type = MEDIA_NOTHING;
media_status = STATUS_CARD;
system_state = SYSTEM_OPEN;
play_state = VCD_STATE_CLOSE;
ircmd_post_func(CMD_FUNC | CMD_FUNC_OPEN);
system_state = SYSTEM_OPEN;
detect_type = 0;
}
}
}
else
iIsCardConflict = 0;
return iIsCardConflict;
}
#endif//#if (defined(DIRECT_ACCESS_MEDIA) && defined(CARD_SETUP_TYPE_3) && defined(SPHE8202_CARD_STORAGE))
/****************************************************************************************\
** Function Name : detect_usb_storage **
** Purposes : **
** Limitations : (none) **
** Arguments : (none) **
** Returns : (none) **
** See also : **
\****************************************************************************************/
#ifdef SUPPORT_USB
UINT32 detect_usb_storage(void)
{
UINT32 iRes = 0;
if (uhci_PlugInOutDetect())//usb is plug in
{
iRes = 1;
}
else//usb is plug out
{
AVD_SetMediaInterrupt();
usb_host_drv_reg_wr(USB_HOST_SOF_CTL,0x0fff0003); //STOP SOF
SLAVE_ENUMERATED = FALSE;
detect_type = 0;
#if defined(SUPPORT_CD_RIPPING) || defined(SUPPORT_FILE_COPYING)
targetDevice = 0;
#endif
storage_type = 0;
iRes = 0;
}
return iRes;
}
#endif//SUPPORT_USB
/*
* Function Name : detect_storage
* Purposes: When ripping going, the rip serve keeps detecting that if the storage existing. If not, then exit the ripping.
* Limitations: (none)
* Arguments: (none)
* Returns: (none)
* See also:
*/
#include "copy_delete_ui.h"
void detect_storage(void)
{
#ifdef SUPPORT_USB
if ((USBEna == TRUE) &&(storage_type==USB_DEVICE))
{
if(detect_usb_storage())
detect_type = storage_type;
else
detect_type = 0;
}
#endif
#ifdef SPHE8202_CARD_STORAGE
if ((CardEna == TRUE)&&((storage_type==SD_CARD_DEVICE)||(storage_type==MS_CARD_DEVICE)))
{
if(CardStorageIsPlugIn())
detect_type = storage_type;
else {
#ifdef SUPPORT_USB
SLAVE_ENUMERATED = FALSE; //Maybe switch from usb to card, then card detached. So we clear the parameter about usb.
#endif //robert.chang, 2007-05-23
detect_type = 0;
storage_type = 0;
}
}
#endif
}
#endif//DIRECT_ACCESS_MEDIA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -