}
}
- /* We count packets even if the temperature was invalid. This way
- * a sample limit on "Memory" data source still works: unused
- * memory slots come through as "----" measurements. */
- devc->num_samples++;
- if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
- sdi->driver->dev_acquisition_stop(sdi);
- }
-
+ /*
+ * We count packets even if the measurement was invalid. This way
+ * a sample limit on "Memory" data source still works: Unused
+ * memory slots come through as "----" measurements.
+ */
+ sr_sw_limits_update_samples_read(&devc->limits, 1);
+ if (sr_sw_limits_check(&devc->limits))
+ sr_dev_acquisition_stop(sdi);
}
SR_PRIV void LIBUSB_CALL uni_t_ut32x_receive_transfer(struct libusb_transfer *transfer)