dm642在线写EPROM.txt

  1. 云栖社区>
  2. 博客列表>
  3. 正文

dm642在线写EPROM.txt

毛毛虫的爹 2013-09-10 14:30:00 浏览367 评论0

摘要: void wirteEPROM() { //#include     unsigned short bufeprom[30],i,val;  FILE *fp;     fp = fopen("d:\\cpci6370.eep","rt+");  i=0;  i= PCI


void wirteEPROM()
{
//#include <stdio.h>
    unsigned short bufeprom[30],i,val;
 FILE *fp;
    fp = fopen("d:\\cpci6370.eep","rt+");
 i=0;
 i= PCI_eepromTest();
 i=  PCI_eepromSize();
//
    fread(bufeprom,2,14,fp);

 fclose(fp);
 val = 0;
 val = 0xaaaa;
 for(i=0;i<13;i++)
 {
           val = val ^ bufeprom[i];
    PCI_eepromWrite(i,bufeprom[i]);
 //   val = PCI_eepromRead(i);
    }
        bufeprom[i] = val;
        PCI_eepromWrite(i,bufeprom[i]);//最后一个字是checksum
 ///////////////////////////////////////////////

}