下面那个((address&0x7ff)/256)是什么意思?
void write(unsigned int address,unsigned char dd){ unsigned char ddd; ddd=((address&0x7ff)/256)<<1; s24();wd24(0xa0|ddd);scl=0;wd24(address);scl=0;wd24(dd);scl=0;p24(); time=0; //time为定时器时间参考,time增加1代表1ms,如果没有用定时器,取消该行 while (1) { s24(); wd24(0xa0|ddd); sda=1; if (sda==0) break; if (time>10) break; //此行防止由于eeprom器件损坏后的死循环 scl=0; } } |