X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=main.c;h=db2bdc016df58f86eef252345f02b667b6c3316d;hb=c9c30f53c4c639d73cadc7c58c28a69090b41261;hp=829492f5704aa8b3b0f4d5f2a1c48a1d4b61709a;hpb=56fc0d6dbca2d46ff2a79275ef6307c4e38bf6a1;p=sigrok-cli.git diff --git a/main.c b/main.c index 829492f..db2bdc0 100644 --- a/main.c +++ b/main.c @@ -136,11 +136,11 @@ static void get_option(void) return; } - cg = select_channel_group(sdi); + cg = lookup_channel_group(sdi); if (!(ci = sr_key_info_name_get(SR_KEY_CONFIG, opt_get))) g_critical("Unknown option '%s'", opt_get); - if ((devargs = parse_generic_arg(opt_config, FALSE))) + if ((devargs = parse_generic_arg(opt_config, FALSE, NULL))) set_dev_options(sdi, devargs); else devargs = NULL; @@ -186,7 +186,7 @@ static void set_options(void) return; } - if (!(devargs = parse_generic_arg(opt_config, FALSE))) + if (!(devargs = parse_generic_arg(opt_config, FALSE, NULL))) return; if (!(devices = device_scan())) { @@ -224,6 +224,11 @@ int main(int argc, char **argv) goto done; #ifdef HAVE_SRD + if (opt_pd_binary && !opt_pds) { + g_critical("Option -B will not take effect in the absence of -P."); + goto done; + } + /* Set the loglevel (amount of messages to output) for libsigrokdecode. */ if (srd_log_loglevel_set(opt_loglevel) != SRD_OK) goto done; @@ -242,6 +247,8 @@ int main(int argc, char **argv) if (opt_pd_binary) { if (setup_pd_binary(opt_pd_binary) != 0) goto done; + if (setup_binary_stdout() != 0) + goto done; if (srd_pd_output_callback_add(srd_sess, SRD_OUTPUT_BINARY, show_pd_binary, NULL) != SRD_OK) goto done; @@ -259,6 +266,7 @@ int main(int argc, char **argv) show_pd_annotations, NULL) != SRD_OK) goto done; } + show_pd_prepare(); } #endif @@ -298,6 +306,8 @@ int main(int argc, char **argv) show_help(); #ifdef HAVE_SRD + if (opt_pds) + show_pd_close(); if (opt_pds) srd_exit(); #endif