void WRITE_FLOAT_EXT_EEPROM(long int n, float data) { //写浮点数到外部EEPROM
int i;
for (i = 0; i < 4; i++)
write_ext_eeprom(i + n, *(&data + i) ) ;
}
float READ_FLOAT_EXT_EEPROM(long int n) {//从外部EEPROM读出浮点数
int i;
float data;
for (i = 0; i < 4; i++)
*(&data + i) = read_ext_eeprom(i + n);
return(data);
}
void WRITE_LONG_EXT_EEPROM(long int n, long data) { //写长整型数到外部EEPROM
int i;
for (i = 0; i < 4; i++)
write_ext_eeprom(i + n, *(&data + i) ) ;
}
float READ_LONG_EXT_EEPROM(long int n) {//从外部EEPROM读出写入的长整型数
int i;
long data;
for (i = 0; i < 4; i++)
*(&data + i) = read_ext_eeprom(i + n);
return(data);
}