tmp[1] |= 0x80;
sigma_write_register(WRITE_TRIGGER_SELECT0, tmp, sizeof(tmp),
- sigma);
+ sigma);
sigma_set_register(WRITE_TRIGGER_SELECT1, 0x30 | i, sigma);
}
switch (hwcap) {
case SR_HWCAP_SAMPLERATE:
- tmp_u64 = value;
- ret = set_samplerate(sdi, *tmp_u64);
+ ret = set_samplerate(sdi, *(uint64_t *)value);
break;
case SR_HWCAP_PROBECONFIG:
- ret = configure_probes(ols, (GSList *) value);
+ ret = configure_probes(ols, (GSList *)value);
break;
case SR_HWCAP_LIMIT_SAMPLES:
tmp_u64 = value;
ret = SR_OK;
break;
case SR_HWCAP_CAPTURE_RATIO:
- tmp_u64 = value;
- ols->capture_ratio = *tmp_u64;
+ ols->capture_ratio = *(uint64_t *)value;
if (ols->capture_ratio < 0 || ols->capture_ratio > 100) {
ols->capture_ratio = 0;
ret = SR_ERR;
struct sr_dev_inst *sdi;
struct fx2_dev *fx2;
int ret;
- uint64_t *tmp_u64;
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
return SR_ERR;
fx2 = sdi->priv;
if (hwcap == SR_HWCAP_SAMPLERATE) {
- tmp_u64 = value;
- ret = set_samplerate(sdi, *tmp_u64);
+ ret = set_samplerate(sdi, *(uint64_t *)value);
} else if (hwcap == SR_HWCAP_PROBECONFIG) {
ret = configure_probes(fx2, (GSList *) value);
} else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
- tmp_u64 = value;
- fx2->limit_samples = *tmp_u64;
+ fx2->limit_samples = *(uint64_t *)value;
ret = SR_OK;
} else {
ret = SR_ERR;
static int hw_dev_config_set(int dev_index, int hwcap, void *value)
{
struct sr_dev_inst *sdi;
- uint64_t *tmp_u64;
struct zp *zp;
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
switch (hwcap) {
case SR_HWCAP_SAMPLERATE:
- tmp_u64 = value;
- return set_samplerate(sdi, *tmp_u64);
+ return set_samplerate(sdi, *(uint64_t *)value);
case SR_HWCAP_PROBECONFIG:
return configure_probes(sdi, (GSList *)value);
case SR_HWCAP_LIMIT_SAMPLES:
- tmp_u64 = value;
- zp->limit_samples = *tmp_u64;
+ zp->limit_samples = *(uint64_t *)value;
return SR_OK;
default:
return SR_ERR;