]> sigrok.org Git - libsigrok.git/blobdiff - hardware/openbench-logic-sniffer/protocol.c
ols: Adjust to GVariant-based sr_config_* functions
[libsigrok.git] / hardware / openbench-logic-sniffer / protocol.c
index 813c5083167d764b714b8b051b2704cb5ef3c812..c5a3cb855b5e70260b91b2a297d27589809dd4f8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the sigrok project.
  *
- * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 
 #include "protocol.h"
 
-SR_PRIV struct sr_dev_driver ols_driver_info;
+extern SR_PRIV struct sr_dev_driver ols_driver_info;
 static struct sr_dev_driver *di = &ols_driver_info;
 
 SR_PRIV int send_shortcommand(struct sr_serial_dev_inst *serial,
@@ -284,16 +284,12 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
 }
 
 SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
-                              uint64_t samplerate,
-                              const struct sr_samplerates *samplerates)
+               const uint64_t samplerate)
 {
        struct dev_context *devc;
 
        devc = sdi->priv;
-       if (devc->max_samplerate) {
-               if (samplerate > devc->max_samplerate)
-                       return SR_ERR_SAMPLERATE;
-       } else if (samplerate < samplerates->low || samplerate > samplerates->high)
+       if (devc->max_samplerate && samplerate > devc->max_samplerate)
                return SR_ERR_SAMPLERATE;
 
        if (samplerate > CLOCK_RATE) {
@@ -311,7 +307,7 @@ SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
        if (devc->flag_reg & FLAG_DEMUX)
                devc->cur_samplerate *= 2;
        if (devc->cur_samplerate != samplerate)
-               sr_err("Can't match samplerate %" PRIu64 ", using %"
+               sr_info("Can't match samplerate %" PRIu64 ", using %"
                       PRIu64 ".", samplerate, devc->cur_samplerate);
 
        return SR_OK;