return beaglelogic_set_triggerflags(devc);
case SR_CONF_CAPTURE_RATIO:
devc->capture_ratio = g_variant_get_uint64(data);
- if (devc->capture_ratio > 100) {
- devc->capture_ratio = 0;
+ if (devc->capture_ratio > 100)
return SR_ERR;
- }
return SR_OK;
default:
return SR_ERR_NA;
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;
+ ret = (devc->capture_ratio > 100) ? SR_ERR : SR_OK;
break;
default:
ret = SR_ERR_NA;
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:
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:
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;
+ ret = (devc->capture_ratio > 100) ? SR_ERR : SR_OK;
break;
case SR_CONF_VOLTAGE_THRESHOLD:
g_variant_get(data, "(dd)", &low, &high);