diff --git a/memory/include/memory.h b/memory/include/memory.h index 7eec4003a4352025704b164f72c58ec60afd538e..9e26965f60f8333c2002cda835427478d06717af 100644 --- a/memory/include/memory.h +++ b/memory/include/memory.h @@ -19,7 +19,6 @@ typedef struct { unsigned char num_mem_modules; TMemModule *mem_modules[MAX_NUM_MEM_MODULES]; - unsigned char device_id; unsigned short int (*eeprom_write_data)(unsigned short int address,unsigned short int data); unsigned short int (*eeprom_read_data)(unsigned short int address,unsigned short int *data); unsigned char data[RAM_SIZE]; @@ -27,7 +26,7 @@ typedef struct unsigned char total_ram; }TMemory; -void mem_init(TMemory *memory,unsigned char device_id); +void mem_init(TMemory *memory); void mem_initialize_data(TMemory *memory); unsigned char mem_add_module(TMemory *memory, TMemModule *module); void mem_do_write(TMemory *memory,unsigned short int start_address,unsigned short int length,unsigned char *data); diff --git a/memory/src/memory.c b/memory/src/memory.c index af30fbf36f18d9c31e08b50fa672aa12e2b4cf57..a2c9e59c2fdc9d6df8736b5f27c3460dae4ef171 100644 --- a/memory/src/memory.c +++ b/memory/src/memory.c @@ -17,7 +17,7 @@ unsigned char mem_in_window(unsigned short int mem_start_address,unsigned short } /* public functions */ -void mem_init(TMemory *memory,unsigned char device_id) +void mem_init(TMemory *memory) { unsigned char i; @@ -26,7 +26,6 @@ void mem_init(TMemory *memory,unsigned char device_id) memory->mem_modules[i]=0x00000000; memory->eeprom_write_data=0x00000000; memory->eeprom_read_data=0x00000000; - memory->device_id=device_id; /* initialize internal variables */ memory->total_eeprom=0; @@ -45,7 +44,7 @@ void mem_initialize_data(TMemory *memory) { for(i=0;i<EEPROM_SIZE;i++) { - if(memory->eeprom_read_data((memory->device_id<<8)+i,&data)) + if(memory->eeprom_read_data(i,&data)) eeprom_data[i]=0x00; else eeprom_data[i]=data&0x00FF; @@ -192,7 +191,7 @@ void mem_do_write(TMemory *memory,unsigned short int start_address,unsigned shor mem_module->write_cmd(mem_module->data,actual_address,actual_length,&data[actual_address-start_address]); if(memory->eeprom_write_data!=0x00000000) for(k=actual_address;k<(actual_address+actual_length);k++) - memory->eeprom_write_data((memory->device_id<<8)+k,data[k-start_address]); + memory->eeprom_write_data(k,data[k-start_address]); } } }