- void EEPROM_Write_Byte(unsigned int uiAddress, unsigned char ucData)
- {
- SREG&=~_BV(7);//先关中断
- /* 等待上一次写操作结束 */
- while(EECR & (1<<EEWE))
- ;
- /* 设置地址和数据寄存器*/
- EEAR = uiAddress;
- EEDR = ucData;
- /* 置位EEMWE */
- EECR |= (1<<EEMWE);
- /* 置位EEWE 以启动写操作*/
- EECR |= (1<<EEWE);
- // asm("nop"); asm("nop");asm("nop"); asm("nop");
- _delay_ms(10);
- SREG|=_BV(7);//开中断}
- //指定地址和指定数组写n个数据
- void EEPROM_Write_Nbyte(unsigned int src_addres, unsigned int *dst_addres,unsigned char num){ unsigned char temp,i; for(i=0;i<num;i++)
- { temp=*(dst_addres+i); EEPROM_Write_Byte( src_addres+i,temp);
- }
- 多字节封装写,存在什么问题。为什么 ../eeprom_use_uarth.c:139: warning: passing argument 2 of 'EEPROM_Write_Nbyte' from incompatible pointer type
- }
|