本帖最后由 一九零三 于 2016-1-17 15:11 编辑
现有两个结构体,依次写入eeprom;分别是
<blockquote>typedef struct {
定义:
global_conf_t global_conf;
现有两种写入读出操作函数:
写入1:
<blockquote>void eeprom_write_block( void* val, void* add, unsigned char size){
读出1:
<blockquote>void eeprom_read_block( void* val, void* add, unsigned char size ){
写入2:
<blockquote>void eeprom_write_block( void* val, void* add, unsigned char size){
读出2:
<blockquote>void eeprom_read_block( void* val, void* add, unsigned char size ){
分别使用上述两种操作依次进行如下先写后读: 读写1操作错误,读写2操作正确,为什么?
eeprom_write_block( (void*)&global_conf, (void*) 0, sizeof(global_conf) );
|