X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fzeroplus.c;h=808b705343acc6140b67b06e39b7c08ec640d8da;hb=5af666a94e67e8a18c0dfa1f4314e1c3e93aa993;hp=d27fb39bda4a6c797ad4e2e8d0ce0e05523653f6;hpb=f366e86c68071fa7888259aa3963b213caa81b51;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index d27fb39b..808b7053 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -65,7 +65,7 @@ static model_t zeroplus_models[] = { {0x7016, "LAP-C(162000)", 16, 2048, 200}, }; -static int hwcaps[] = { +static const int hwcaps[] = { SR_HWCAP_LOGIC_ANALYZER, SR_HWCAP_SAMPLERATE, SR_HWCAP_PROBECONFIG, @@ -114,7 +114,7 @@ static libusb_context *usb_context = NULL; * TODO: We shouldn't support 150MHz and 200MHz on devices that don't go up * that high. */ -static uint64_t supported_samplerates[] = { +static const uint64_t supported_samplerates[] = { SR_HZ(100), SR_HZ(500), SR_KHZ(1), @@ -136,7 +136,7 @@ static uint64_t supported_samplerates[] = { 0, }; -static struct sr_samplerates samplerates = { +static const struct sr_samplerates samplerates = { 0, 0, 0, @@ -157,7 +157,7 @@ struct context { struct sr_usb_dev_inst *usb; }; -static int hw_dev_config_set(int dev_index, int hwcap, void *value); +static int hw_dev_config_set(int dev_index, int hwcap, const void *value); static unsigned int get_memory_size(int type) { @@ -282,11 +282,11 @@ static void close_dev(struct sr_dev_inst *sdi) sdi->status = SR_ST_INACTIVE; } -static int configure_probes(struct sr_dev_inst *sdi, GSList *probes) +static int configure_probes(struct sr_dev_inst *sdi, const GSList *probes) { struct context *ctx; - struct sr_probe *probe; - GSList *l; + const struct sr_probe *probe; + const GSList *l; int probe_bit, stage, i; char *tc; @@ -499,11 +499,11 @@ static int hw_cleanup(void) return SR_OK; } -static void *hw_dev_info_get(int dev_index, int dev_info_id) +static const void *hw_dev_info_get(int dev_index, int dev_info_id) { struct sr_dev_inst *sdi; struct context *ctx; - void *info; + const void *info; if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) { sr_err("zp: %s: sdi was NULL", __func__); @@ -566,7 +566,7 @@ static int hw_dev_status_get(int dev_index) return SR_ST_NOT_FOUND; } -static int *hw_hwcap_get_all(void) +static const int *hw_hwcap_get_all(void) { return hwcaps; } @@ -599,7 +599,7 @@ static int set_samplerate(struct sr_dev_inst *sdi, uint64_t samplerate) return SR_OK; } -static int hw_dev_config_set(int dev_index, int hwcap, void *value) +static int hw_dev_config_set(int dev_index, int hwcap, const void *value) { struct sr_dev_inst *sdi; struct context *ctx; @@ -616,11 +616,11 @@ static int hw_dev_config_set(int dev_index, int hwcap, void *value) switch (hwcap) { case SR_HWCAP_SAMPLERATE: - return set_samplerate(sdi, *(uint64_t *)value); + return set_samplerate(sdi, *(const uint64_t *)value); case SR_HWCAP_PROBECONFIG: - return configure_probes(sdi, (GSList *)value); + return configure_probes(sdi, (const GSList *)value); case SR_HWCAP_LIMIT_SAMPLES: - ctx->limit_samples = *(uint64_t *)value; + ctx->limit_samples = *(const uint64_t *)value; return SR_OK; default: return SR_ERR;