X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fchronovu-la%2Fprotocol.c;fp=src%2Fhardware%2Fchronovu-la%2Fprotocol.c;h=599472c50458339e62d68220a8e40d86a653beee;hb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;hp=a4689fa3b2140cd5a2a8e05fa29efe112fb300a1;hpb=208c1d35435626a11afa1ab301b2071b2a4e187b;p=libsigrok.git diff --git a/src/hardware/chronovu-la/protocol.c b/src/hardware/chronovu-la/protocol.c index a4689fa3..599472c5 100644 --- a/src/hardware/chronovu-la/protocol.c +++ b/src/hardware/chronovu-la/protocol.c @@ -401,16 +401,19 @@ SR_PRIV int cv_read_block(struct dev_context *devc) return SR_OK; } -SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) +SR_PRIV void cv_send_block_to_session_bus(const struct sr_dev_inst *sdi, int block) { int i, idx; uint8_t sample, expected_sample, tmp8; struct sr_datafeed_packet packet; struct sr_datafeed_logic logic; int trigger_point; /* Relative trigger point (in this block). */ + struct dev_context *devc; /* Note: Caller ensures devc/devc->ftdic != NULL and block > 0. */ + devc = sdi->priv; + /* TODO: Implement/test proper trigger support for the LA16. */ /* Check if we can find the trigger condition in this block. */ @@ -458,7 +461,7 @@ SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) logic.length = BS; logic.unitsize = devc->prof->num_channels / 8; logic.data = devc->final_buf + (block * BS); - sr_session_send(devc->cb_data, &packet); + sr_session_send(sdi, &packet); return; } @@ -481,7 +484,7 @@ SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) logic.length = trigger_point; logic.unitsize = devc->prof->num_channels / 8; logic.data = devc->final_buf + (block * BS); - sr_session_send(devc->cb_data, &packet); + sr_session_send(sdi, &packet); } /* Send the SR_DF_TRIGGER packet to the session bus. */ @@ -489,7 +492,7 @@ SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) (block * BS) + trigger_point); packet.type = SR_DF_TRIGGER; packet.payload = NULL; - sr_session_send(devc->cb_data, &packet); + sr_session_send(sdi, &packet); /* If at least one sample is located after the trigger... */ if (trigger_point < (BS - 1)) { @@ -502,6 +505,6 @@ SR_PRIV void cv_send_block_to_session_bus(struct dev_context *devc, int block) logic.length = BS - trigger_point; logic.unitsize = devc->prof->num_channels / 8; logic.data = devc->final_buf + (block * BS) + trigger_point; - sr_session_send(devc->cb_data, &packet); + sr_session_send(sdi, &packet); } }