X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=33339d6bcc86eb7250c5ff9b0880cd0a29d66fb4;hb=b04cbd0ba3301396bd9e1e31c6f462087caf1de8;hp=1d1388bae3bdc174488dc58677132ea5743498e2;hpb=8eadb70a37946c268d9bef312478096e96009c3d;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index 1d1388ba..33339d6b 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -276,7 +276,6 @@ static int config_set(uint32_t key, GVariant *data, break; case SR_CONF_PATTERN_MODE: stropt = g_variant_get_string(data, NULL); - flag = 0xffff; if (!strcmp(stropt, STR_PATTERN_NONE)) { sr_info("Disabling test modes."); flag = 0x0000; @@ -289,10 +288,9 @@ static int config_set(uint32_t key, GVariant *data, } else { return SR_ERR; } - if (flag != 0xffff) { - devc->flag_reg &= ~(FLAG_INTERNAL_TEST_MODE | FLAG_EXTERNAL_TEST_MODE); - devc->flag_reg |= flag; - } + devc->flag_reg &= ~FLAG_INTERNAL_TEST_MODE; + devc->flag_reg &= ~FLAG_EXTERNAL_TEST_MODE; + devc->flag_reg |= flag; break; case SR_CONF_SWAP: if (g_variant_get_boolean(data)) {