X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhung-chang-dso-2100%2Fprotocol.c;h=92d52c35e9a26d11401f330847f6310eb7bacd95;hb=bf03e06d57c3189458cc6d6c613afb28a586ce1e;hp=cfe84f41278cefdac12dc16029b176112bd4cb37;hpb=545101338ac4b283278f3922081428bc81a58810;p=libsigrok.git diff --git a/src/hardware/hung-chang-dso-2100/protocol.c b/src/hardware/hung-chang-dso-2100/protocol.c index cfe84f41..92d52c35 100644 --- a/src/hardware/hung-chang-dso-2100/protocol.c +++ b/src/hardware/hung-chang-dso-2100/protocol.c @@ -79,11 +79,11 @@ * trigger on (rising or falling) * The next state is 0x0C * 0x0C Same as state 0x0F but expects the calibration - * value for the first channel's position + * value for the first channel's position * (POS1 in the schematics) * The next state is 0x0D * 0x0D Same as state 0x0F but expects the calibration - * value for the second channel's position + * value for the second channel's position * (POS2 in the schematics) * The next state is 0x0E * 0x0E Same as state 0x0F but expects the trigger level @@ -396,12 +396,8 @@ static int read_subframe(const struct sr_dev_inst *sdi, uint8_t *buf) if (interleave) num *= 2; if (!devc->step) { - struct sr_datafeed_packet packet = { - .type = SR_DF_TRIGGER - }; - push_samples(sdi, buf, 6); - sr_session_send(sdi, &packet); + std_session_send_df_trigger(sdi); buf += 6; num -= 6; } @@ -419,8 +415,7 @@ static int read_subframe(const struct sr_dev_inst *sdi, uint8_t *buf) SR_PRIV int hung_chang_dso_2100_poll(int fd, int revents, void *cb_data) { - struct sr_datafeed_packet packet = { .type = SR_DF_FRAME_BEGIN }; - const struct sr_dev_inst *sdi; + struct sr_dev_inst *sdi; struct dev_context *devc; uint8_t state, buf[1000]; @@ -447,7 +442,7 @@ SR_PRIV int hung_chang_dso_2100_poll(int fd, int revents, void *cb_data) return FALSE; } - sr_session_send(sdi, &packet); + std_session_send_df_frame_begin(sdi); if (devc->channel) { while (read_subframe(sdi, buf)) { @@ -460,11 +455,10 @@ SR_PRIV int hung_chang_dso_2100_poll(int fd, int revents, void *cb_data) } } - packet.type = SR_DF_FRAME_END; - sr_session_send(sdi, &packet); + std_session_send_df_frame_end(sdi); if (++devc->frame >= devc->frame_limit) - hung_chang_dso_2100_dev_acquisition_stop(sdi); + sr_dev_acquisition_stop(sdi); else hung_chang_dso_2100_move_to(sdi, 0x21);