baylibre-acme: Convert to SR_DF_ANALOG.
This commit is contained in:
parent
55bee166eb
commit
633531416b
|
@ -699,7 +699,10 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data)
|
||||||
{
|
{
|
||||||
uint64_t nrexpiration;
|
uint64_t nrexpiration;
|
||||||
struct sr_datafeed_packet packet, framep;
|
struct sr_datafeed_packet packet, framep;
|
||||||
struct sr_datafeed_analog_old analog;
|
struct sr_datafeed_analog analog;
|
||||||
|
struct sr_analog_encoding encoding;
|
||||||
|
struct sr_analog_meaning meaning;
|
||||||
|
struct sr_analog_spec spec;
|
||||||
struct sr_dev_inst *sdi;
|
struct sr_dev_inst *sdi;
|
||||||
struct sr_channel *ch;
|
struct sr_channel *ch;
|
||||||
struct channel_priv *chp;
|
struct channel_priv *chp;
|
||||||
|
@ -718,9 +721,9 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data)
|
||||||
if (!devc)
|
if (!devc)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
packet.type = SR_DF_ANALOG_OLD;
|
packet.type = SR_DF_ANALOG;
|
||||||
packet.payload = &analog;
|
packet.payload = &analog;
|
||||||
memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
|
sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
|
||||||
|
|
||||||
if (read(devc->timer_fd, &nrexpiration, sizeof(nrexpiration)) < 0) {
|
if (read(devc->timer_fd, &nrexpiration, sizeof(nrexpiration)) < 0) {
|
||||||
sr_warn("Failed to read timer information");
|
sr_warn("Failed to read timer information");
|
||||||
|
@ -766,10 +769,10 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data)
|
||||||
continue;
|
continue;
|
||||||
chonly.next = NULL;
|
chonly.next = NULL;
|
||||||
chonly.data = ch;
|
chonly.data = ch;
|
||||||
analog.channels = &chonly;
|
|
||||||
analog.num_samples = 1;
|
analog.num_samples = 1;
|
||||||
analog.mq = channel_to_mq(chl->data);
|
analog.meaning->channels = &chonly;
|
||||||
analog.unit = channel_to_unit(ch);
|
analog.meaning->mq = channel_to_mq(chl->data);
|
||||||
|
analog.meaning->unit = channel_to_unit(ch);
|
||||||
|
|
||||||
if (i < 1)
|
if (i < 1)
|
||||||
chp->val = read_sample(ch);
|
chp->val = read_sample(ch);
|
||||||
|
|
Loading…
Reference in New Issue