I'm qurious about some code in CSDIOControllerBase::GetCommandResponse member function
- From: shjkun@xxxxxxxxx
- Date: Wed, 28 May 2008 01:43:19 -0700 (PDT)
How are u?
As I mentioned in the titile box, I'm qurious about some code in
CSDIOControllerBase::GetCommandResponse member function.
SD_API_STATUS CSDIOControllerBase::GetCommandResponse(PSD_BUS_REQUEST
pRequest)
{
....
DEBUGMSG (SDHC_RESPONSE_ZONE,(TEXT("GetCommandResponse
started")));
PUCHAR respBuff; // response buffer
DWORD dwWaitCount = 0;
//----- 1. Wait for the response information to get arrive at the
controller -----
while(!(vm_pSDIReg->SDICSTA & RESPONSE_RECEIVED))
{
...
}
respBuff = pRequest->CommandResponse.ResponseBuffer;
switch(pRequest->CommandResponse.ResponseType)
{
....
case ResponseR5:
case ResponseR6:
//--- SHORT RESPONSE (48 bits total)---
// Format: { START_BIT(1) | TRANSMISSION_BIT(1) |
COMMAND_INDEX(6) | RCA(16) |
// CARD_STATUS(16) | CRC7(7) | END_BIT(1) }
//
*(respBuff ) = (BYTE)(START_BIT | TRANSMISSION_BIT |
pRequest->CommandCode);
*(respBuff + 1) = (BYTE)(vm_pSDIReg->SDIRSP0 );
*(respBuff + 2) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 8 );
*(respBuff + 3) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 16);
*(respBuff + 4) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 24);
*(respBuff + 5) = (BYTE)(vm_pSDIReg->SDIRSP1 >> 24); <--
....
}
As I know,
*(respBuff + 1) = (BYTE)(vm_pSDIReg->SDIRSP0 );
*(respBuff + 2) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 8 );
*(respBuff + 3) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 16);
*(respBuff + 4) = (BYTE)(vm_pSDIReg->SDIRSP0 >> 24);
the code, as we can see above this line, is coded to adapt little
endian.
but
*(respBuff + 5) = (BYTE)(vm_pSDIReg->SDIRSP1 >> 24);
I think, if we adapt this code to little endian we must code like
below
*(respBuff + 5) = (BYTE)(vm_pSDIReg->SDIRSP1);
but it dosn't do like that.
why ??
.
- Follow-Ups:
- Re: I'm qurious about some code in CSDIOControllerBase::GetCommandResponse member function
- From: Paul G. Tobey [eMVP]
- Re: I'm qurious about some code in CSDIOControllerBase::GetCommandResponse member function
- Prev by Date: Re: Access violation in MSXML.dll ???
- Next by Date: successional question : about CSDIOControllerBase::GetCommandResponse
- Previous by thread: ARM 16-bit thumb instructions
- Next by thread: Re: I'm qurious about some code in CSDIOControllerBase::GetCommandResponse member function
- Index(es):