46
Client software / Re: Jawi's Logic Sniffer client software - releases
In LogicSnifferConfig.java
Code: [Select]
/**
* Returns whether or not the device returns its samples in "reverse" order.
*
* @return <code>true</code> if the samples are returned in reverse order,
* <code>false</code> otherwise.
*/
public boolean isSamplesInReverseOrder()
{
if ( this.deviceProfile != null )
{
return this.deviceProfile.isSamplesInReverseOrder();
}
return true; //false;
}
Changing the default return to true when the this.deviceProfile is null causes the samples to be shown FIFO as I require. When it is false they are always displayed FILO. The setting in the cfg file is never returned. I will not begin to pretend I know anything about java its classes to guess why.
What we can be sure about is that this.deviceProfile is null. Other properties that are accessed in the same manner from LogicSnifferAcquisitionTask.java also appear to be broken in 0.9.6 though they worked in 0.9.5.
I also came across a couple other little oddity.
In LogicSnifferAcquisitionTask.java your code to reverse the buffer is in:
Code: [Select]
private int readSamples( int aSampleIdx, final int[] aBuffer ) throws IOException, InterruptedException
However it cannot really go there because this function is called twice. Once in awaitTrigger( buffer ); and then again a few lines later. This means the first sample is moved on its own and then finally overridden by the last sample.
I commented out that part of the code and instead added this in:
Code: [Select]
public AcquisitionResult call() throws IOException, InterruptedException:
// read all other samples
sampleIdx = readSamples( sampleIdx, buffer );
+ // In case the device sends its samples in "reverse" order, we need to
+ // revert it now, before processing them further...
+ if ( this.config.isSamplesInReverseOrder() )
+ {
+ HostUtils.reverse( buffer );
+ }
Well that is as far as I can go with it. Seems I did something that broke the tests and while a compile works I no longer can create a package. Any way, I got a version that works the way I need it to so I can continue with all the firmware.
edit (JaWi): added some code blocks to aid readability...