diff options
author | Michael Pavone <pavone@retrodev.com> | 2016-02-24 19:24:13 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2016-02-24 19:24:13 -0800 |
commit | eab28e704f032328b957de0d4f880180ade83aa1 (patch) | |
tree | 3d2b8315deaafcf1a77d8f95301142e6fe03cea3 | |
parent | f48a739560baaeaab289ac2e045bf3a8014cf7ba (diff) |
Accept address on 128-byte EEPROMs on both read and write
-rw-r--r-- | romdb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -108,6 +108,9 @@ void set_scl(eeprom_state *state, uint8_t val) if (state->latch & 1) { state->state = I2C_READ; state->counter = 8; + if (state->size < 256) { + state->address = state->latch >> 1; + } state->latch = state->buffer[state->address]; } else { if (state->size < 256) { @@ -365,7 +368,7 @@ uint16_t read_eeprom_i2c_w(uint32_t address, void * context) if (map->sda_read_bit < 16) { ret = get_sda(&gen->eeprom) << map->sda_read_bit; } - return ret; + return ret; } uint8_t read_eeprom_i2c_b(uint32_t address, void * context) |