X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=44af4017077d8d79f4503fa1d720ed0678381cc6;hb=76bc28c3f1cbd88f01eda7251e9f4f1d88c506f2;hp=c5c53ce82f3a8e57828b895a9962ec50527edfac;hpb=6433156c3275df933e4bf6dcfb020c91fca0ae86;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index c5c53ce8..44af4017 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include "protocol.h" static const uint32_t devopts[] = { @@ -298,10 +299,9 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd break; case SR_CONF_CAPTURE_RATIO: devc->capture_ratio = g_variant_get_uint64(data); - if (devc->capture_ratio < 0 || devc->capture_ratio > 100) { - devc->capture_ratio = 0; + if (devc->capture_ratio < 0 || devc->capture_ratio > 100) ret = SR_ERR; - } else + else ret = SR_OK; break; case SR_CONF_EXTERNAL_CLOCK: