示例#1
0
int readBlock(int blockNum, void *ptr)
{
    if (gUseRamdisk)
    {
        memcpy(ptr, RAMDISK_BASE + blockNum * BLOCK_SIZE, BLOCK_SIZE);
        return BLOCK_SIZE;
    }
    else
        return readSdmmcDevice(blockNum, ptr);
}
示例#2
0
int main()
{
	char *buf = (char*) 0x200000;
		
	if (initSdmmcDevice() < 0)
	{
		printf("error initializing card\n");
		return -1;
	}

	// Read blocks in reverse order to verify address is set correctly.
	for (int i = TRANSFER_LENGTH - 1; i >= 0; i--)
		readSdmmcDevice(i, buf + i * BLOCK_SIZE);
	
	return 0;
}