Sigma: Small cleanups.

This commit is contained in:
Håvard Espeland 2010-05-03 21:35:02 +02:00
parent 36b1c8e61b
commit bdfc7a8974
1 changed files with 4 additions and 6 deletions

View File

@ -747,8 +747,8 @@ static int get_trigger_offset(uint16_t *samples, uint16_t last_sample,
continue; continue;
/* Falling edge. */ /* Falling edge. */
if ((last_sample & t->fallingmask) != t->fallingmask || (samples[i] & if ((last_sample & t->fallingmask) != t->fallingmask ||
t->fallingmask) != 0) (samples[i] & t->fallingmask) != 0)
continue; continue;
break; break;
@ -779,14 +779,11 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
uint16_t *event; uint16_t *event;
uint16_t cur_sample; uint16_t cur_sample;
int triggerts = -1; int triggerts = -1;
int triggeroff = 0;
/* Check if trigger is in this chunk. */ /* 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 - 1; triggerpos -= EVENTS_PER_CLUSTER - 1;
else
triggeroff = 3;
if (triggerpos < 0) if (triggerpos < 0)
triggerpos = 0; triggerpos = 0;
@ -853,7 +850,8 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
* the actual event. We therefore look at the next * the actual event. We therefore look at the next
* samples to pinpoint the exact position of the trigger. * samples to pinpoint the exact position of the trigger.
*/ */
tosend = get_trigger_offset(samples, *lastsample, &trigger); tosend = get_trigger_offset(samples, *lastsample,
&trigger);
if (tosend > 0) { if (tosend > 0) {
packet.type = DF_LOGIC16; packet.type = DF_LOGIC16;