int err, devcnt, i, j;
/* Avoid compiler warnings. */
- deviceinfo = deviceinfo;
+ (void)deviceinfo;
if (libusb_init(&usb_context) != 0) {
sr_warn("Failed to initialize USB.");
struct timeval tv;
/* Avoid compiler warnings. */
- fd = fd;
- revents = revents;
- user_data = user_data;
+ (void)fd;
+ (void)revents;
+ (void)user_data;
tv.tv_sec = tv.tv_usec = 0;
libusb_handle_events_timeout(usb_context, &tv);
/* Match on this trigger stage. */
fx2->trigger_buffer[fx2->trigger_stage] = cur_buf[i];
fx2->trigger_stage++;
+
if (fx2->trigger_stage == NUM_TRIGGER_STAGES || fx2->trigger_mask[fx2->trigger_stage] == 0) {
/* Match on all trigger stages, we're done. */
trigger_offset = i + 1;
* Tell the frontend we hit the trigger here.
*/
packet.type = SR_DF_TRIGGER;
- packet.timeoffset = (num_samples - fx2->trigger_stage) * fx2->period_ps;
+ packet.timeoffset = (num_samples + i) * fx2->period_ps;
packet.duration = 0;
packet.payload = NULL;
sr_session_bus(fx2->session_data, &packet);
* skipping past them.
*/
packet.type = SR_DF_LOGIC;
- packet.timeoffset = (num_samples - fx2->trigger_stage) * fx2->period_ps;
+ packet.timeoffset = (num_samples + i) * fx2->period_ps;
packet.duration = fx2->trigger_stage * fx2->period_ps;
packet.payload = &logic;
logic.length = fx2->trigger_stage;
struct sr_datafeed_packet packet;
/* Avoid compiler warnings. */
- device_index = device_index;
+ (void)device_index;
packet.type = SR_DF_END;
sr_session_bus(session_data, &packet);