# HG changeset patch # User Michael Pavone # Date 1456370653 28800 # Node ID 4c17c7f463311bae0168bfd2136139923997f28b # Parent 9364dad5561aa278a834ba50800f032ebcf0bba4 Accept address on 128-byte EEPROMs on both read and write diff -r 9364dad5561a -r 4c17c7f46331 romdb.c --- a/romdb.c Tue Feb 23 21:17:56 2016 -0800 +++ b/romdb.c Wed Feb 24 19:24:13 2016 -0800 @@ -108,6 +108,9 @@ 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 @@ 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)