* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "sigrok-cli.h"
-#include "config.h"
+#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
+#include "sigrok-cli.h"
#ifdef HAVE_SRD
static GHashTable *pd_ann_visible = NULL;
g_hash_table_destroy(options);
if (channels)
g_hash_table_destroy(channels);
- if (pd_name)
- g_free(pd_name);
+ g_free(pd_name);
return ret;
}
void *channel_target;
struct sr_channel *ch;
GHashTableIter iter;
- int num_channels;
channel_map = value;
channel_list = user_data;
g_hash_table_insert(channel_indices, g_strdup(channel_id), var);
}
- num_channels = g_slist_length(channel_list);
- srd_inst_channel_set_all(di, channel_indices, (num_channels + 7) / 8);
+ srd_inst_channel_set_all(di, channel_indices);
}
void map_pd_channels(struct sr_dev_inst *sdi)
}
}
-int setup_pd_stack(char *opt_pds, char *opt_pd_stack, char *opt_pd_annotations)
+int setup_pd_stack(char *opt_pds, char *opt_pd_annotations)
{
struct srd_decoder_inst *di_from, *di_to;
int ret, i;
/* Set up the protocol decoder stack. */
pds = g_strsplit(opt_pds, ",", 0);
if (g_strv_length(pds) > 1) {
- if (opt_pd_stack) {
- /* A stack setup was specified, use that. */
- g_strfreev(pds);
- pds = g_strsplit(opt_pd_stack, ",", 0);
- if (g_strv_length(pds) < 2) {
- g_strfreev(pds);
- g_critical("Specify at least two protocol decoders to stack.");
- return 1;
- }
- }
-
/* First PD goes at the bottom of the stack. */
ids = g_strsplit(pds[0], ":", 0);
if (!(di_from = srd_inst_find_by_id(srd_sess, ids[0]))) {