pFlashInfo->dwNumBlocks = NUM_OF_BLOCKS;
pFlashInfo->wSectorsPerBlock = PAGES_PER_BLOCK;
pFlashInfo->wDataBytesPerSector = NAND_SECTOR_SIZE;
pFlashInfo->dwBytesPerBlock = (PAGES_PER_BLOCK * NAND_SECTOR_SIZE);
这些宏的相关定义在Src\Common\Smartmedia\fmd\nand.h:
#define NUM_OF_BLOCKS (stDeviceInfo.nNumOfBlks)
#define PAGES_PER_BLOCK (stDeviceInfo.nPagesPerBlk)
#define SECTORS_PER_PAGE (stDeviceInfo.nSctsPerPage)
#undef SECTOR_SIZE
#define SECTOR_SIZE (512)
#define NAND_SECTOR_SIZE (SECTOR_SIZE*SECTORS_PER_PAGE)
但是stDeviceInfo.nNumOfBlks、stDeviceInfo.nPagesPerBlk和stDeviceInfo.nSctsPerPage这三个结构体成员是在哪里赋值的呢?我在整个BSP下面都没有找到相应的赋值,在这里向大家请教了,谢谢!