/* Flash-w.c: 1. To write a value which you input to flash memory at segment 0x9000 which offset is 0 to 65535 and show it on the monitor. 2. The value you input will write to Flash memory and automatically increase by 1. ** Press 'q' or 'Q' to quit program. Compiler: BC++ 3.1, Turbo C ++ 1.01(3.01) (free from http://community.borland.com/museum) Compile mode: Large Project: Flash-w.c ..\..\lib\7188e.lib Hordware: 7188E [05/Dec/2006] by Liam [July,13,2011] by Nicholas */ #include #include #include #include #include #include "..\..\lib\7188e.h" void main(void) { int seg, data; char c; unsigned e=0x9000,i=0; Print("\r\nPlease Input a value writting to segment 0x9000 of Flash Member: "); Scanf("%d", &seg); FlashErase(e); while(i<65535) { FlashWrite(e, i, seg); Print("\r\nThe value %d is writting to offset %d of Flash Memory", seg, i); i++; seg++; if(i%100==0) { Print("\r\nPress q to quit or any key to continue..."); c=Getch(); if ((c=='q') || (c=='Q')) return; } } }