More consistent spelling of "samplerate".
This commit is contained in:
parent
4c9ffa83cf
commit
4c100f3244
|
@ -344,7 +344,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
|||
case DI_TRIGGER_TYPES:
|
||||
info = (char *) TRIGGER_TYPES;
|
||||
break;
|
||||
case DI_CUR_SAMPLE_RATE:
|
||||
case DI_CUR_SAMPLERATE:
|
||||
info = &cur_samplerate;
|
||||
break;
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
|||
packet->payload = (unsigned char *) header;
|
||||
header->feed_version = 1;
|
||||
gettimeofday(&header->starttime, NULL);
|
||||
header->rate = cur_samplerate;
|
||||
header->samplerate = cur_samplerate;
|
||||
header->protocol_id = PROTO_RAW;
|
||||
header->num_probes = NUM_PROBES;
|
||||
session_bus(session_device_id, packet);
|
||||
|
|
|
@ -92,7 +92,7 @@ static struct samplerates samplerates = {
|
|||
};
|
||||
|
||||
/* TODO: all of these should go in a device-specific struct */
|
||||
static uint64_t cur_sample_rate = 0;
|
||||
static uint64_t cur_samplerate = 0;
|
||||
static uint64_t limit_samples = 0;
|
||||
static uint8_t probe_mask = 0, \
|
||||
trigger_mask[NUM_TRIGGER_STAGES] = {0}, \
|
||||
|
@ -459,7 +459,7 @@ static int hw_opendev(int device_index)
|
|||
return SIGROK_NOK;
|
||||
}
|
||||
|
||||
if(cur_sample_rate == 0) {
|
||||
if(cur_samplerate == 0) {
|
||||
/* sample rate hasn't been set; default to the slowest it has */
|
||||
if(hw_set_configuration(device_index, HWCAP_SAMPLERATE, &supported_samplerates[0]) == SIGROK_NOK)
|
||||
return SIGROK_NOK;
|
||||
|
@ -523,8 +523,8 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
|||
case DI_TRIGGER_TYPES:
|
||||
info = TRIGGER_TYPES;
|
||||
break;
|
||||
case DI_CUR_SAMPLE_RATE:
|
||||
info = &cur_sample_rate;
|
||||
case DI_CUR_SAMPLERATE:
|
||||
info = &cur_samplerate;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -566,7 +566,7 @@ static int set_configuration_samplerate(struct sigrok_device_instance *sdi, uint
|
|||
|
||||
divider = (uint8_t) (48 / (float) (samplerate/1000000)) - 1;
|
||||
|
||||
g_message("setting sample rate to %"PRIu64" Hz (divider %d)", samplerate, divider);
|
||||
g_message("setting samplerate to %"PRIu64" Hz (divider %d)", samplerate, divider);
|
||||
buf[0] = 0x01;
|
||||
buf[1] = divider;
|
||||
ret = libusb_bulk_transfer(sdi->usb->devhdl, 1 | LIBUSB_ENDPOINT_OUT, buf, 2, &result, 500);
|
||||
|
@ -574,7 +574,7 @@ static int set_configuration_samplerate(struct sigrok_device_instance *sdi, uint
|
|||
g_warning("failed to set samplerate: %d", ret);
|
||||
return SIGROK_NOK;
|
||||
}
|
||||
cur_sample_rate = samplerate;
|
||||
cur_samplerate = samplerate;
|
||||
|
||||
return SIGROK_OK;
|
||||
}
|
||||
|
@ -790,7 +790,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
|||
packet->payload = (unsigned char *) header;
|
||||
header->feed_version = 1;
|
||||
gettimeofday(&header->starttime, NULL);
|
||||
header->rate = cur_sample_rate;
|
||||
header->samplerate = cur_samplerate;
|
||||
header->protocol_id = PROTO_RAW;
|
||||
header->num_probes = NUM_PROBES;
|
||||
session_bus(session_device_id, packet);
|
||||
|
|
|
@ -74,7 +74,7 @@ static GSList *device_instances = NULL;
|
|||
|
||||
static libusb_context *usb_context = NULL;
|
||||
|
||||
/* The hardware supports more sample rates than these, but these are the options
|
||||
/* The hardware supports more samplerates than these, but these are the options
|
||||
hardcoded into the vendor's Windows GUI */
|
||||
|
||||
// XXX we shouldn't support 150MHz and 200MHz on devices that don't go up that high
|
||||
|
@ -393,7 +393,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
|
|||
case DI_TRIGGER_TYPES:
|
||||
info = TRIGGER_TYPES;
|
||||
break;
|
||||
case DI_CUR_SAMPLE_RATE:
|
||||
case DI_CUR_SAMPLERATE:
|
||||
info = &cur_samplerate;
|
||||
break;
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
|
|||
packet.payload = (unsigned char *) &header;
|
||||
header.feed_version = 1;
|
||||
gettimeofday(&header.starttime, NULL);
|
||||
header.rate = cur_samplerate;
|
||||
header.samplerate = cur_samplerate;
|
||||
header.protocol_id = PROTO_RAW;
|
||||
header.num_probes = num_channels;
|
||||
session_bus(session_device_id, &packet);
|
||||
|
|
|
@ -93,7 +93,7 @@ static void init(struct output *o, int default_spl)
|
|||
|
||||
ctx->header = malloc(512);
|
||||
num_probes = g_slist_length(o->device->probes);
|
||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLE_RATE));
|
||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLERATE));
|
||||
snprintf(ctx->header, 512, "Acquisition with %d/%d probes at ", ctx->num_enabled_probes, num_probes);
|
||||
if(samplerate >= GHZ(1))
|
||||
snprintf(ctx->header + strlen(ctx->header), 512, "%"PRIu64" GHz", samplerate / 1000000000);
|
||||
|
|
|
@ -74,7 +74,7 @@ static void init(struct output *o)
|
|||
ctx->header = calloc(1, MAX_HEADER_LEN + 1);
|
||||
num_probes = g_slist_length(o->device->probes);
|
||||
samplerate = *((uint64_t *) o->device->plugin->get_device_info(
|
||||
o->device->plugin_index, DI_CUR_SAMPLE_RATE));
|
||||
o->device->plugin_index, DI_CUR_SAMPLERATE));
|
||||
|
||||
/* Samplerate string */
|
||||
if (samplerate >= GHZ(1))
|
||||
|
|
10
sigrok.h
10
sigrok.h
|
@ -81,7 +81,7 @@ struct datafeed_packet {
|
|||
struct datafeed_header {
|
||||
int feed_version;
|
||||
struct timeval starttime;
|
||||
uint64_t rate;
|
||||
uint64_t samplerate;
|
||||
int protocol_id;
|
||||
int num_probes;
|
||||
};
|
||||
|
@ -197,7 +197,7 @@ void device_trigger_set(struct device *device, int probenum, char *trigger);
|
|||
enum {
|
||||
HWCAP_DUMMY, // used to terminate lists
|
||||
HWCAP_LOGIC_ANALYZER,
|
||||
HWCAP_SAMPLERATE, // change sample rate
|
||||
HWCAP_SAMPLERATE, // change samplerate
|
||||
HWCAP_PROBECONFIG, // configure probe mask
|
||||
HWCAP_CAPTURE_RATIO, // set pre-trigger / post-trigger ratio
|
||||
HWCAP_LIMIT_MSEC, // set a time limit for sample acquisition
|
||||
|
@ -263,12 +263,12 @@ enum {
|
|||
DI_INSTANCE,
|
||||
/* The number of probes connected to this device */
|
||||
DI_NUM_PROBES,
|
||||
/* Sample rates supported by this device, (struct samplerates) */
|
||||
/* Samplerates supported by this device, (struct samplerates) */
|
||||
DI_SAMPLERATES,
|
||||
/* Types of trigger supported, out of "01crf" (char *) */
|
||||
DI_TRIGGER_TYPES,
|
||||
/* The currently set sample rate in Hz (uint64_t) */
|
||||
DI_CUR_SAMPLE_RATE,
|
||||
/* The currently set samplerate in Hz (uint64_t) */
|
||||
DI_CUR_SAMPLERATE,
|
||||
};
|
||||
|
||||
/* a device supports either a range of samplerates with steps of a given
|
||||
|
|
Loading…
Reference in New Issue