ols: fixed demux mode disable noise filter

Demux flag wasn't getting set off if one non-demux sample was ran
beforehand.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
This commit is contained in:
Matt Ranostay 2013-09-06 22:27:46 -07:00 committed by Bert Vermeulen
parent 6a53bde671
commit 6ebe003985
1 changed files with 3 additions and 0 deletions

View File

@ -302,10 +302,13 @@ SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
return SR_ERR_SAMPLERATE;
if (samplerate > CLOCK_RATE) {
sr_info("Enabling demux mode.");
devc->flag_reg |= FLAG_DEMUX;
devc->flag_reg &= ~FLAG_FILTER;
devc->max_probes = NUM_PROBES / 2;
devc->cur_samplerate_divider = (CLOCK_RATE * 2 / samplerate) - 1;
} else {
sr_info("Disabling demux mode.");
devc->flag_reg &= ~FLAG_DEMUX;
devc->flag_reg |= FLAG_FILTER;
devc->max_probes = NUM_PROBES;