#include #include #include #include "..\..\lib\8000E.h" #define BUFFER_SIZE (4096+127) uchar Wdata[BUFFER_SIZE]; uchar Rdata[128]; int MaxBlock=0; void TestS256(int size) { int i,key,block,offset; uchar *p1,*p2; unsigned long addr=0,error=0,MaxRamSize; MaxRamSize=size*1024UL; srand(GetTimeTicks()); for(i=0;i%02x]",offset,offset,*p2,*p1); if(Kbhit()){ Getch(); goto End; } } p1++; p2++; } } End: Print("\n\r--------->%lu errors\n\r",error); } void main(int argc,char *argv[]) { int ii; int status,mr; int size; unsigned block=0; switch(S256_Init()) { case -256://low battery and 256K Print("low battery and 256K\n\r"); size=256; MaxBlock=2048; break; case 256://battery OK and 256K Print("battery OK and 256K\n\r"); size=256; MaxBlock=2048; break; case -512://low battery and 512K Print("low battery and 512K\n\r"); size=512; MaxBlock=4096; break; case 512://battery OK and 512K Print("battery OK and 512K\n\r"); size=512; MaxBlock=4096; break; case 0: Print("Can not find S256/S512!"); exit(1); } Print("Press any key to stop test.\n\r"); while(!Kbhit()) TestS256(size); Getch(); }