📄 vndreq.c
字号:
if (G_Card_Type == K_MEDIA_NANDF)
G_pucCtrlDataPointer[0] = 1;
#endif
}
break;
case 0x54: //Get Object Count
//richie@vc0422
////printf("0x54 G_USR_FileCount=%d,G_usCtrlDataLength=%d\n",G_USR_FileCount,G_usCtrlDataLength);
if (wValue == 0x00)
{
G_pucCtrlDataPointer[0] = M_LoByteOfWord(G_USR_FileCount);
G_pucCtrlDataPointer[1] = M_HiByteOfWord(G_USR_FileCount);
}
break;
//patch4.3@richie@md0603 begin
#if (SINGLE_DIRECTORY == 0)
case 0x55: //Get Dir
if (wIndex == 0x00)
{
G_pucCtrlDataPointer[0] = M_LoByteOfWord(G_USR_TotalDirectory);
G_pucCtrlDataPointer[1] = M_HiByteOfWord(G_USR_TotalDirectory);
}
else if (wIndex == 0x02)
{
//patch4.4@ada@DirectoryIndexOrder begin
//G_pucCtrlDataPointer[0] = M_LoByteOfWord(G_USR_Dir1CountIndex);
//G_pucCtrlDataPointer[1] = M_HiByteOfWord(G_USR_Dir1CountIndex);
G_pucCtrlDataPointer[0] = M_LoByteOfWord(G_USR_Dir1Count);
G_pucCtrlDataPointer[1] = M_HiByteOfWord(G_USR_Dir1Count);
//patch4.4@ada@DirectoryIndexOrder end
}
break;
#endif
//patch4.3@richie@md0603 end
default:
break;
}
}
//-----------------------------------------------------------------------------
//VNDREQ_PreOutDataPhase
//-----------------------------------------------------------------------------
void VNDREQ_PreOutDataPhase(void) USING_1
/*++
Routine Description:
pre-process setting of following out data phase
Arguments:
none
Return Value:
none
--*/
{
G_pucCtrlDataPointer = G_ucCtrlData;
}
//-----------------------------------------------------------------------------
//VNDREQ_PostInDataPhase
//-----------------------------------------------------------------------------
void VNDREQ_PostInDataPhase(void) USING_1
/*++
Routine Description:
post-process data of complete in data phase
Arguments:
none
Return Value:
none
--*/
{
}
//-----------------------------------------------------------------------------
//VNDREQ_PostOutDataPhase
//-----------------------------------------------------------------------------
void VNDREQ_PostOutDataPhase(void) USING_1
/*++
Routine Description:
post-process data of complete out data phase
Arguments:
none
Return Value:
none
--*/
{
ULONG i;
USHORT wIndex;
UCHAR temp;
UCHAR ArgIndex;
//cytsai@1211
if ((G_pCtrlCommand->bRequest == 0xfe) || (G_pCtrlCommand->bRequest == 0xfd)) //Deferred Procedure Call in main lock loop
{
//lock fields of request
G_bRequestLock =
G_bRequestLog =
G_pCtrlCommand->bRequest;
G_wValueLock = G_pCtrlCommand->wValue;
G_wIndexLock = G_pCtrlCommand->wIndex;
G_L2_ModuleID = (UCHAR)(G_wIndexLock>>8);
G_L1_ModuleID = G_L2_ModuleID;
G_L1_FuncID = (UCHAR)(G_wIndexLock&0x00ff);
G_L2_FuncID = G_L1_FuncID;
for (ArgIndex=0; ArgIndex<16; ArgIndex++) // Collect L2 Function parameter from USB buffer
G_ArgBuf[ArgIndex] = M_UCHARToULONG(G_ucCtrlData[ArgIndex*4+3],G_ucCtrlData[ArgIndex*4+2],G_ucCtrlData[ArgIndex*4+1],G_ucCtrlData[ArgIndex*4]);
}
wIndex = G_pCtrlCommand->wIndex;
switch (G_pCtrlCommand->bRequest)
{
case 0x00: //register write
// check address of burst write
if (wIndex == 0x217c)
wIndex = 0x2117;
//set data from buffer
for (i = 0; i < G_usCtrlDataIndex; i++)
XBYTE[(ULONG) wIndex + i] = G_pucCtrlDataPointer[i];
break;
case 0x21: //set state
switch (wIndex)
{
case 0x00: //get ucState
G_ucState |= (G_pucCtrlDataPointer[0] & 0x0f);
break;
case 0x01: //get ucState2
G_ucState2 = G_pucCtrlDataPointer[0];
break;
case 0x02: //get ucState3
G_ucState3 = G_pucCtrlDataPointer[0];
break;
default:
break;
}
break;
case 0x22: //set error code
G_ulErrorCode = (ULONG) G_pucCtrlDataPointer[0];
G_ulErrorCode |= ((ULONG) G_pucCtrlDataPointer[1]) << 8;
G_ulErrorCode |= ((ULONG) G_pucCtrlDataPointer[2]) << 16;
G_ulErrorCode |= ((ULONG) G_pucCtrlDataPointer[3]) << 24;
break;
case 0x24: //set color information
SENSOR_SetColorInformation(wIndex);
break;
case 0x25: //set camera size index
INITIO_SetCameraSizeIndex(wIndex); //cch
break;
case 0x26: //set quantization table index
G_Image_QTableIndex = G_pucCtrlDataPointer[0];
break;
//patch5.0@richie@sdram mapping begin
//patch4.5@richie@image type begin
case 0x27: //Set Image Type
G_Image_Type = G_pucCtrlDataPointer[0];
temp = G_Image_Type & 0x07;
//if (temp != 1)
//{
//if (temp != 0)
// temp --;
if (temp == 0) //RawData 10 bit
XBYTE[0x270e] = 0;
else if (temp == 1) //RawData 8 bit
XBYTE[0x270e] = 0;
else if (temp == 2) //YUV422 Non-compress
XBYTE[0x270e] = 1;
else if (temp == 3) //YUV422 compress
XBYTE[0x270e] = 2;
else if (temp == 4) //YUV420 Non-compress
XBYTE[0x270e] = 3;
else if (temp == 5) //YUV420 Non-compress-UV
XBYTE[0x270e] = 3;
else if (temp == 6) //YUV420 Compress
XBYTE[0x270e] = 5;
else if (temp == 7) //YUV420 Compress-UV
XBYTE[0x270e] = 5;
//XBYTE[0x270e] = temp;
//patch4.4.1@richie@noncompress begin
//XBYTE[0x2310] = temp;
G_ucNonCompFlag = 1;
//patch4.4.1@richie@noncompress end
//}
break;
//patch4.5@richie@image type end
//patch5.0@richie@sdram mapping end
//patch4.5@richie@partial file upload begin
case 0x60:
//lock fields of request
G_bRequestLock =
G_bRequestLog =
G_pCtrlCommand->bRequest;
G_wValueLock = G_pCtrlCommand->wValue;
G_wIndexLock = G_pCtrlCommand->wIndex;
printf("Partial File\n");
for (ArgIndex=0; ArgIndex<16; ArgIndex++) // Collect L2 Function parameter from USB buffer
G_ArgBuf[ArgIndex] = M_UCHARToULONG(G_ucCtrlData[ArgIndex*4+3],G_ucCtrlData[ArgIndex*4+2],G_ucCtrlData[ArgIndex*4+1],G_ucCtrlData[ArgIndex*4]);
printf("arg1 = %lx,arg2 = %lx,arg3 = %lx\n",G_ArgBuf[0],G_ArgBuf[1],G_ArgBuf[2]);
break;
//patch4.5@richie@partial file upload end
default:
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -