return SR_OK;
}
+SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate)
+{
+ int i;
+
+ for (i = 0; ARRAY_SIZE(samplerates_200); i++)
+ if (samplerate == samplerates_200[i])
+ break;
+
+ if (i == ARRAY_SIZE(samplerates_200) || samplerate > devc->max_samplerate) {
+ sr_err("Unsupported samplerate: %" PRIu64 "Hz.", samplerate);
+ return SR_ERR_ARG;
+ }
+
+ sr_info("Setting samplerate to %" PRIu64 "Hz.", samplerate);
+
+ if (samplerate >= SR_MHZ(1))
+ analyzer_set_freq(samplerate / SR_MHZ(1), FREQ_SCALE_MHZ);
+ else if (samplerate >= SR_KHZ(1))
+ analyzer_set_freq(samplerate / SR_KHZ(1), FREQ_SCALE_KHZ);
+ else
+ analyzer_set_freq(samplerate, FREQ_SCALE_HZ);
+
+ devc->cur_samplerate = samplerate;
+
+ return SR_OK;
+}
+
static int clear_instances(void)
{
GSList *l;
return 0;
}
-SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate)
-{
- int i;
-
- for (i = 0; zp_supported_samplerates_200[i]; i++)
- if (samplerate == zp_supported_samplerates_200[i])
- break;
-
- if (!zp_supported_samplerates_200[i] || samplerate > devc->max_samplerate) {
- sr_err("Unsupported samplerate: %" PRIu64 "Hz.", samplerate);
- return SR_ERR_ARG;
- }
-
- sr_info("Setting samplerate to %" PRIu64 "Hz.", samplerate);
-
- if (samplerate >= SR_MHZ(1))
- analyzer_set_freq(samplerate / SR_MHZ(1), FREQ_SCALE_MHZ);
- else if (samplerate >= SR_KHZ(1))
- analyzer_set_freq(samplerate / SR_KHZ(1), FREQ_SCALE_KHZ);
- else
- analyzer_set_freq(samplerate, FREQ_SCALE_HZ);
-
- devc->cur_samplerate = samplerate;
-
- return SR_OK;
-}
-
SR_PRIV int set_limit_samples(struct dev_context *devc, uint64_t samples)
{
devc->limit_samples = samples;
const struct zp_model *prof;
};
-extern const uint64_t zp_supported_samplerates_200[];
-
SR_PRIV unsigned int get_memory_size(int type);
SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate);
SR_PRIV int set_limit_samples(struct dev_context *devc, uint64_t samples);