static void get_markers(double *offset, double *mag) { int ret, sum = MARKER_AVG; struct marker_type *markers = NULL; const char *device_ref; device_ref = plugin_get_device_by_reference(CAP_DEVICE_ALT); *offset = 0; *mag = 0; for (sum = 0; sum < MARKER_AVG; sum++) { if (device_ref) { do { ret = plugin_data_capture_of_plot(plot_xcorr_4ch, device_ref, NULL, &markers); } while (ret == -EBUSY); } if (markers) { *offset += markers[0].x; *mag += markers[0].y; } } *offset /= MARKER_AVG; *mag /= MARKER_AVG; DBG("offset: %f, MAG0 %f", *offset, *mag); plugin_data_capture_of_plot(plot_xcorr_4ch, NULL, NULL, &markers); }
static void get_markers(int *offset, long long *mag, long long *mag1, long long *mag2, long long *x1) { int ret, sum = MARKER_AVG; struct marker_type *markers = NULL; const char *device_ref = NULL; device_ref = plugin_get_device_by_reference(CAP_DEVICE_ALT); *offset = 0; *mag = 0; *mag1 = 0; *mag2 = 0; *x1 = 0; for (sum = 0; sum < MARKER_AVG; sum++) { if (device_ref) { do { ret = plugin_data_capture_with_domain(device_ref, NULL, &markers, XCORR_PLOT); } while ((ret == -EBUSY)); } if (markers) { *offset += markers[0].x; *mag += markers[0].y; *mag1 += markers[1].y; *mag2 += markers[2].y; *x1 += markers[1].x; } } *offset /= MARKER_AVG; *mag /= MARKER_AVG; *mag1 /= MARKER_AVG; *mag2 /= MARKER_AVG; *x1 /= MARKER_AVG; DBG("offset: %d, MAG0 %d, MAG1 %d, MAG2 %d", *offset, (int)*mag, (int)*mag1, (int)*mag2); plugin_data_capture_with_domain(NULL, NULL, &markers, XCORR_PLOT); }