/* Logic channels, all in one channel group. */
cg = g_malloc0(sizeof(struct sr_channel_group));
cg->name = g_strdup("Logic");
- for (j = 0; j < 16; j++) {
+ for (j = 0; j < NUM_CHANNELS; j++) {
sprintf(channel_name, "%d", j);
ch = sr_channel_new(sdi, j, SR_CHANNEL_LOGIC,
TRUE, channel_name);
return;
}
- for (int ch = 0; ch < 2; ch++) {
+ for (int ch = 0; ch < NUM_CHANNELS; ch++) {
if (!devc->ch_enabled[ch])
continue;
/* TODO: Check malloc return value. */
analog.data = g_try_malloc(num_samples * sizeof(float));
- for (int ch = 0; ch < 2; ch++) {
+ for (int ch = 0; ch < NUM_CHANNELS; ch++) {
if (!devc->ch_enabled[ch])
continue;
#include "libsigrok-internal.h"
#include "protocol.h"
-#define NUM_CHANNELS 2
-
static int send_begin(const struct sr_dev_inst *sdi)
{
struct sr_usb_dev_inst *usb;
/* All models have this for their "fast" mode. */
#define FRAMESIZE_SMALL (10 * 1024)
+#define NUM_CHANNELS 2
+
enum control_requests {
CTRL_READ_EEPROM = 0xa2,
CTRL_GETSPEED = 0xb2,
#define UNKNOWN_ADDRESS 0xff
#define MAX_RENUM_DELAY_MS 3000
+#define NUM_CHANNELS 16
+
static const uint32_t drvopts[] = {
SR_CONF_LOGIC_ANALYZER,
};
sdi->inst_type = SR_INST_USB;
sdi->conn = usb;
- for (i = 0; i < 16; i++) {
+ for (i = 0; i < NUM_CHANNELS; i++) {
snprintf(channel_name, sizeof(channel_name), "D%i", i);
sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_name);
}