From: Bartosz Golaszewski Date: Fri, 9 Oct 2015 13:52:28 +0000 (+0200) Subject: baylibre-acme: Fix EEPROM fields endianness. X-Git-Tag: libsigrok-0.4.0~229 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a7da85f5299dd4162b26ab9c64224e52b52470ab;p=libsigrok.git baylibre-acme: Fix EEPROM fields endianness. Use RB32 instead of RL32 since integer types in probe EEPROM are in network byte order. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index db1b5757..72dee87a 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -281,9 +281,9 @@ static int read_probe_eeprom(unsigned int addr, struct probe_eeprom *eeprom) if (rd != EEPROM_SIZE) return -1; - eeprom->type = RL32(eeprom_buf + EEPROM_OFF_TYPE); - eeprom->rev = RL32(eeprom_buf + EEPROM_OFF_REV); - eeprom->shunt = RL32(eeprom_buf + EEPROM_OFF_SHUNT); + eeprom->type = RB32(eeprom_buf + EEPROM_OFF_TYPE); + eeprom->rev = RB32(eeprom_buf + EEPROM_OFF_REV); + eeprom->shunt = RB32(eeprom_buf + EEPROM_OFF_SHUNT); eeprom->pwr_sw = R8(eeprom_buf + EEPROM_OFF_PWR_SW); /* Don't care about the serial number and tag for now. */