]> sigrok.org Git - libsigrok.git/commitdiff
baylibre-acme: Fix EEPROM fields endianness.
authorBartosz Golaszewski <redacted>
Fri, 9 Oct 2015 13:52:28 +0000 (15:52 +0200)
committerBartosz Golaszewski <redacted>
Fri, 9 Oct 2015 13:52:28 +0000 (15:52 +0200)
Use RB32 instead of RL32 since integer types in probe EEPROM are in network
byte order.

Signed-off-by: Bartosz Golaszewski <redacted>
src/hardware/baylibre-acme/protocol.c

index db1b57573d9173ade5fe425b9d425e4df76ed040..72dee87a7245f114f185b117ad37b03683ba8f8b 100644 (file)
@@ -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. */