在Readpages回buf验证处,有些怪怪的(....StdDriver\HSUSBD_HID_Transfer\WindowsTool....)
想知道为何这样比对
for(i=0;i<TEST_PAGES*PAGE_SIZE;i++)
buf = i&0xFF;
WritePages(buf, TEST_BASE / PAGE_SIZE, TEST_PAGES);
memset(buf, 0xCC, TEST_PAGES*PAGE_SIZE);
ReadPages(buf, TEST_BASE / PAGE_SIZE, TEST_PAGES);
isErr = 0;
for(i=0;i<TEST_PAGES*PAGE_SIZE;i++)
{
if(buf != 0xFF)
{
isErr = 1;
break;
}
}
buf(in)处的比对是与0xFF进行比对
几乎同样的例子,在Nano120的范例(....StdDriver\USBD_HID_Transfer\WindowsTool....)是
for(i = 0; i < TEST_PAGES * PAGE_SIZE; i++)
buf = i & 0xFF;
WritePages(buf, TEST_BASE / PAGE_SIZE, TEST_PAGES);
memset(buf, 0xCC, TEST_PAGES * PAGE_SIZE);
ReadPages(buf, TEST_BASE / PAGE_SIZE, TEST_PAGES);
isErr = 0;
for(i = 0; i < TEST_PAGES * PAGE_SIZE; i++)
{
if(buf != (i & 0xFF))
{
isErr = 1;
break;
}
}
|
|