Пример #1
0
/**
* @brief            USBF_MSC_Polling
*
* @param            none
* @return           process result
* @return           USBF_MSC_RET_OK         -> normally end
* @return           USBF_MSC_RET_STAGE_NG   -> class action stage abnormal
* @return           USBF_MSC_RET_USBFUNC_NG -> USB function driver action abnormal
* @return          set the return value as follows
* @return          B'0000X0X0
* @return            |||||||+-- reserve (definite value 0)
* @return            ||||||+--- parameter invalid
* @return            |||||+---- reserve (definite value 0)
* @return            ||||+----- LUN iniformation incorrect
* @return            |||+------ reserve (definite value 0)
* @return            ||+------- reserve (definite value 0)
* @return            |+-------- reserve (definite value 0)
* @return            +--------- reserve (definite value 0)
*
**/
uint8_t USBF_MSC_Polling(void)
{
    uint8_t ret = USBF_MSC_RET_OK;     /* return value               */

    /* check low layer drive action state and if state is abnormal, */
    /* set the low lyaer USB function drive action unnorlmality bit of return value */
    if (check_usb_status(API_POLLING) != TRUE)
    {
        ret |= USBF_MSC_RET_USBFUNC_NG;
    }

    /* check class action stage and stage is abnormal,set the class action stage abnormal bit of rerurn value */
    if (check_stage() != TRUE)
    {
        ret |= USBF_MSC_RET_STAGE_NG;
    }

    /* when result is correct,call BOT transfer main process */
    if (ret == USBF_MSC_RET_OK)
    {
        msc_bot_main();
    }

    return (ret);
}
Пример #2
0
/**
* @brief            USBF_MSC_Request
*
* @param            pSetupPkt    setup packet data storage
* @return           process result
* @return           USBF_MSC_RET_OK           ->normally end
* @return           USBF_MSC_RET_STAGE_NG     ->class action stage abnormal
* @return           USBF_MSC_RET_INVALID_PARAM->parameter incorrect
* @return           USBF_MSC_RET_USBFUNC_NG   -> USB function driver action abnormal
* @return          set the return value as follows
* @return          B'0000X0X0
* @return            |||||||+-- reserve (definite value 0)
* @return            ||||||+--- parameter invalid
* @return            |||||+---- reserve (definite value 0)
* @return            ||||+----- LUN iniformation incorrect
* @return            |||+------ reserve (definite value 0)
* @return            ||+------- reserve (definite value 0)
* @return            |+-------- reserve (definite value 0)
* @return            +--------- reserve (definite value 0)
*
**/
uint8_t USBF_MSC_Request(const USBF_ST_SETUP_INFO * pSetupPkt)
{
    uint8_t ret = USBF_MSC_RET_OK;     /* return value               */

    /* when transfer data size is not 0,do following process */
    if (pSetupPkt->wLength != 0)
    {
        /* check usb function driver action state and if state is abnormal, */
        /* set the low lyaer USB function drive action unnorlmality bit of return value */
        if (check_usb_status(API_CLASS_REQUEST) != TRUE)
        {
            ret |= USBF_MSC_RET_USBFUNC_NG;
        }

        /* check class action stage and stage is abnormal,set the class action stage abnormal bit of rerurn value */
        if (check_stage() != TRUE)
        {
            ret |= USBF_MSC_RET_STAGE_NG;
        }
    }

    /* when result is correct,call class request process and set return value */
    if (ret == USBF_MSC_RET_OK)
    {
        ret |= msc_bot_class_request(pSetupPkt);
    }

    return (ret);
}
Пример #3
0
void movie_sub_from_usb(void)
{
	int str_len = 0;
	WndStatus get_path_ret = WND_CANCLE;
	
	if(check_usb_status() == false)
	{
		PopDlg  pop;
		memset(&pop, 0, sizeof(PopDlg));
    		pop.type = POP_TYPE_OK;
   		pop.str = STR_ID_INSERT_USB;
   		pop.mode = POP_MODE_UNBLOCK;
		#ifdef APP_HD
		pop.pos.x =200;
		pop.pos.y = 170;
		#endif
		#ifdef APP_HD
		pop.pos.x =450;
		pop.pos.y = 270;
		#endif				
					popdlg_create(&pop);
//		media_popmsg(pop.pos.x, pop.pos.y, pop.str, POPMSG_TYPE_OK);
	}
	else
	{
		FileListParam file_para;
		memset(&file_para, 0, sizeof(file_para));

		file_para.cur_path = s_file_path_bak;
		file_para.dest_path = &s_file_path;
		file_para.suffix = SUFFIX_SUBT;
		file_para.dest_mode = DEST_MODE_FILE;
		
		get_path_ret = app_get_file_path_dlg(&file_para);
		
		if(get_path_ret == WND_OK)
		{
			if(s_file_path != NULL)
			{
				////backup the path...////
				if(s_file_path_bak != NULL)
				{
					GxCore_Free(s_file_path_bak);
					s_file_path_bak = NULL;
				}
			
				str_len = strlen(s_file_path);
				s_file_path_bak = (char *)GxCore_Malloc(str_len + 1);
				if(s_file_path_bak != NULL)
				{
					memcpy(s_file_path_bak, s_file_path, str_len);
					s_file_path_bak[str_len] = '\0';
				}
			}
		}
	}
}