]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/baylibre-acme/protocol.c
sysclk-lwla: Remove global driver instance pointer
[libsigrok.git] / src / hardware / baylibre-acme / protocol.c
index db1b57573d9173ade5fe425b9d425e4df76ed040..6726667ed78d3d29888d4d4bb8ed927de8608de6 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. */
 
@@ -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");