X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fprotocol.c;h=0bef0b22bdfe7cb9aef7170d47c571463b48ada8;hb=9cfc695ffe5f04622f61acb98ea4ac91c3f4ffc3;hp=db1b57573d9173ade5fe425b9d425e4df76ed040;hpb=4c3a4bca321df48455d4484753783dc6da17aa15;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index db1b5757..0bef0b22 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -277,13 +277,13 @@ static int read_probe_eeprom(unsigned int addr, struct probe_eeprom *eeprom) return -1; rd = read(fd, eeprom_buf, EEPROM_SIZE); - g_close(fd, NULL); + close(fd); 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. */ @@ -651,7 +651,8 @@ static float read_sample(struct sr_channel *ch) SR_PRIV int bl_acme_open_channel(struct sr_channel *ch) { struct channel_priv *chp; - char path[64], *file; + char path[64]; + const char *file; int fd; chp = ch->priv; @@ -696,7 +697,7 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) uint32_t cur_time, elapsed_time; uint64_t nrexpiration; struct sr_datafeed_packet packet, framep; - struct sr_datafeed_analog analog; + struct sr_datafeed_analog_old analog; struct sr_dev_inst *sdi; struct sr_channel *ch; struct channel_priv *chp; @@ -715,9 +716,9 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) if (!devc) return TRUE; - packet.type = SR_DF_ANALOG; + packet.type = SR_DF_ANALOG_OLD; packet.payload = &analog; - memset(&analog, 0, sizeof(struct sr_datafeed_analog)); + memset(&analog, 0, sizeof(struct sr_datafeed_analog_old)); if (read(devc->timer_fd, &nrexpiration, sizeof(nrexpiration)) < 0) { sr_warn("Failed to read timer information");