Sigma: Minor cleanups.

This commit is contained in:
Håvard Espeland 2010-05-02 19:21:05 +02:00
parent 11fc8d9d93
commit 4ae1f45136
1 changed files with 9 additions and 8 deletions

View File

@ -48,7 +48,6 @@ static int cur_firmware = -1;
static int num_probes = 0; static int num_probes = 0;
static int samples_per_event = 0; static int samples_per_event = 0;
static int capture_ratio = 50; static int capture_ratio = 50;
static struct sigma_trigger trigger; static struct sigma_trigger trigger;
static uint64_t supported_samplerates[] = { static uint64_t supported_samplerates[] = {
@ -243,7 +242,7 @@ static int sigma_read_dram(uint16_t startchunk, size_t numchunks, uint8_t *data)
return sigma_read(data, numchunks * CHUNK_SIZE); return sigma_read(data, numchunks * CHUNK_SIZE);
} }
/* Upload trigger look-up tables to Sigma */ /* Upload trigger look-up tables to Sigma. */
static int sigma_write_trigger_lut(struct triggerlut *lut) static int sigma_write_trigger_lut(struct triggerlut *lut)
{ {
int i; int i;
@ -745,6 +744,7 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
int triggerts = -1; int triggerts = -1;
int triggeroff = 0; int triggeroff = 0;
/* Check if trigger is in this chunk. */
if (triggerpos != -1) { if (triggerpos != -1) {
if (cur_samplerate <= MHZ(50)) if (cur_samplerate <= MHZ(50))
triggerpos -= EVENTS_PER_CLUSTER; triggerpos -= EVENTS_PER_CLUSTER;
@ -811,11 +811,12 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
sent = 0; sent = 0;
if (i == triggerts) { if (i == triggerts) {
/* /*
* Trigger is presumptively only accurate to event, i.e. * Trigger is presumptively not accurate to sample.
* for 100 and 200 MHz, where multiple samples are coded * However, it always trigger before the actual event,
* in a single event, the trigger does not match the * so it would be possible to forward to correct position
* exact sample. * here by manually checking for trigger condition.
*/ */
tosend = (triggerpos % 7) - triggeroff; tosend = (triggerpos % 7) - triggeroff;
if (tosend > 0) { if (tosend > 0) {