X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffx2lafw%2Fapi.c;h=baa1476d0bbd022ada03d6ed382e31354f5c30cf;hb=7637cc60ba0201202eec98f66d8494e6ba3d53bd;hp=1fb2235f1e57bedf1ed61c216eaf0ce6361a94ae;hpb=4f840ce965b1c30c5ab75afecc56193cbaf5c1b3;p=libsigrok.git diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c index 1fb2235f..baa1476d 100644 --- a/src/hardware/fx2lafw/api.c +++ b/src/hardware/fx2lafw/api.c @@ -106,9 +106,8 @@ static const uint32_t devopts[] = { }; static const char *channel_names[] = { - "0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", "10", "11", "12", "13", "14", "15", - NULL, + "0", "1", "2", "3", "4", "5", "6", "7", + "8", "9", "10", "11", "12", "13", "14", "15", }; static const int32_t soft_trigger_matches[] = { @@ -518,30 +517,30 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd ret = SR_OK; switch (key) { - case SR_CONF_SAMPLERATE: - arg = g_variant_get_uint64(data); - for (i = 0; i < ARRAY_SIZE(samplerates); i++) { - if (samplerates[i] == arg) { - devc->cur_samplerate = arg; - break; - } + case SR_CONF_SAMPLERATE: + arg = g_variant_get_uint64(data); + for (i = 0; i < ARRAY_SIZE(samplerates); i++) { + if (samplerates[i] == arg) { + devc->cur_samplerate = arg; + break; } - if (i == ARRAY_SIZE(samplerates)) - ret = SR_ERR_ARG; - break; - case SR_CONF_LIMIT_SAMPLES: - devc->limit_samples = g_variant_get_uint64(data); - break; - case SR_CONF_CAPTURE_RATIO: - devc->capture_ratio = g_variant_get_uint64(data); - if (devc->capture_ratio > 100) { - devc->capture_ratio = 0; - ret = SR_ERR; - } else - ret = SR_OK; - break; - default: - ret = SR_ERR_NA; + } + if (i == ARRAY_SIZE(samplerates)) + ret = SR_ERR_ARG; + break; + case SR_CONF_LIMIT_SAMPLES: + devc->limit_samples = g_variant_get_uint64(data); + break; + case SR_CONF_CAPTURE_RATIO: + devc->capture_ratio = g_variant_get_uint64(data); + if (devc->capture_ratio > 100) { + devc->capture_ratio = 0; + ret = SR_ERR; + } else + ret = SR_OK; + break; + default: + ret = SR_ERR_NA; } return ret; @@ -598,9 +597,8 @@ static int receive_data(int fd, int revents, void *cb_data) (void)fd; (void)revents; - (void)cb_data; - drvc = (struct drv_context *) cb_data; + drvc = (struct drv_context *)cb_data; tv.tv_sec = tv.tv_usec = 0; libusb_handle_events_timeout(drvc->sr_ctx->libusb_ctx, &tv);