arachnid-labs-re-load-pro: Simplify a code chunk.

This commit is contained in:
Uwe Hermann 2018-03-03 19:24:35 +01:00
parent d7e348f481
commit 0aaaee2dd3
1 changed files with 2 additions and 6 deletions

View File

@ -247,12 +247,8 @@ static int config_get(uint32_t key, GVariant **data,
*data = g_variant_new_boolean(devc->otp_active); *data = g_variant_new_boolean(devc->otp_active);
break; break;
case SR_CONF_UNDER_VOLTAGE_CONDITION: case SR_CONF_UNDER_VOLTAGE_CONDITION:
if (reloadpro_get_under_voltage_threshold(sdi, &fvalue) == SR_OK) { if (reloadpro_get_under_voltage_threshold(sdi, &fvalue) == SR_OK)
if (fvalue == .0) *data = g_variant_new_boolean(fvalue != 0.0);
*data = g_variant_new_boolean(FALSE);
else
*data = g_variant_new_boolean(TRUE);
}
break; break;
case SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE: case SR_CONF_UNDER_VOLTAGE_CONDITION_ACTIVE:
*data = g_variant_new_boolean(devc->uvc_active); *data = g_variant_new_boolean(devc->uvc_active);