X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhardware%2Fchronovu-la%2Fprotocol.c;h=ae8f427a7e9af002e6069382493be45375e47728;hb=HEAD;hp=599472c50458339e62d68220a8e40d86a653beee;hpb=695dc859c15ba4190f5c1aa2e1a6e2dc6a6e5845;p=libsigrok.git diff --git a/src/hardware/chronovu-la/protocol.c b/src/hardware/chronovu-la/protocol.c index 599472c5..ae8f427a 100644 --- a/src/hardware/chronovu-la/protocol.c +++ b/src/hardware/chronovu-la/protocol.c @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -203,7 +202,7 @@ static int close_usb_reset_sequencer(struct dev_context *devc) sr_dbg("Purging buffers, resetting+closing FTDI device."); /* Log errors, but ignore them (i.e., don't abort). */ - if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) + if ((ret = PURGE_FTDI_BOTH(devc->ftdic)) < 0) sr_err("Failed to purge FTDI buffers (%d): %s.", ret, ftdi_get_error_string(devc->ftdic)); if ((ret = ftdi_usb_reset(devc->ftdic)) < 0) @@ -301,6 +300,11 @@ SR_PRIV int cv_convert_trigger(const struct sr_dev_inst *sdi) || match->match == SR_TRIGGER_RISING) devc->trigger_pattern |= channel_bit; + /* LA8 and LA16 support state triggering. */ + if (match->match == SR_TRIGGER_ONE + || match->match == SR_TRIGGER_ZERO) + devc->trigger_mask |= channel_bit; + /* LA16 (but not LA8) supports edge triggering. */ if ((devc->prof->model == CHRONOVU_LA16)) { if (match->match == SR_TRIGGER_RISING @@ -490,9 +494,7 @@ SR_PRIV void cv_send_block_to_session_bus(const struct sr_dev_inst *sdi, int blo /* Send the SR_DF_TRIGGER packet to the session bus. */ sr_spew("Sending SR_DF_TRIGGER packet, sample = %d.", (block * BS) + trigger_point); - packet.type = SR_DF_TRIGGER; - packet.payload = NULL; - sr_session_send(sdi, &packet); + std_session_send_df_trigger(sdi); /* If at least one sample is located after the trigger... */ if (trigger_point < (BS - 1)) {