Skip to content

Commit

Permalink
Simple comment fix
Browse files Browse the repository at this point in the history
  • Loading branch information
keesj committed Dec 24, 2009
1 parent ca998f9 commit ce5dd66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 56 deletions.
8 changes: 0 additions & 8 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ int main(int argc, char **argv)
slogic_tune(handle, transfer_buffer_size, n_transfer_buffers,
libusb_debug_level);

#if 0
/* apparently one need to at least read once before the driver continues */
printf("Reading byte\n");
unsigned char b;
int ret = slogic_readbyte(handle, &b);
assert(ret == 0);
printf("ret = %d, byte = 0x02%x\n", ret, b);
#endif
uint8_t *buffer = malloc(n_samples);
assert(buffer);

Expand Down
60 changes: 12 additions & 48 deletions slogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
#include <string.h>

#define DEFAULT_N_TRANSFER_BUFFERS 4

#define DEFAULT_TRANSFER_BUFFER_SIZE 4 * 1024

// EP1 OUT
/*
* define EP1 OUT , EP1 IN, EP2 IN and EP6 OUT
*/
#define COMMAND_OUT_ENDPOINT 0x01
// EP1 IN
#define COMMAND_IN_ENDPOINT 0x81
// EP2 IN
#define STREAMING_DATA_IN_ENDPOINT 0x82
// EP6 OUT
#define STREAMING_DATA_OUT_ENDPOINT 0x06

//Bus 006 Device 006: ID 0925:3881 Lakeview Research
Expand All @@ -35,9 +33,8 @@ struct slogic_handle {
};

/*
* Sample Rate
* Sample Rates
*/

struct slogic_sample_rate sample_rates[] = {
{1, "24MHz", 24000000},
{2, "16MHz", 16000000},
Expand Down Expand Up @@ -278,30 +275,6 @@ void slogic_read_samples_callback(struct libusb_transfer *transfer)
stransfer->recording->failed = 1;
}
}
#if 0
if (tcounter == 200) {
struct libusb_transfer *transfer;
unsigned char cmd[2];
cmd[0] = 0x01;
//cmd[1] = DELAY_FOR_12000000;
//cmd[1] = DELAY_FOR_8000000;
cmd[1] = DELAY_FOR_4000000;
//cmd[1] = DELAY_FOR_200000;
transfer = libusb_alloc_transfer(0); // 0 == bulk transfer
assert(transfer);
libusb_fill_bulk_transfer(transfer,
stransfer->shandle->device_handle,
0x01, cmd, 2,
slogic_read_samples_callback_start_log,
NULL, 10);
ret = libusb_submit_transfer(transfer);
if (ret) {
fprintf(stderr, "libusb_submit_transfer: %s\n",
usbutil_error_to_string(ret));
return;
}
}
#endif

stransfer->recording->sample_count += transfer->actual_length;
printf
Expand All @@ -310,22 +283,13 @@ void slogic_read_samples_callback(struct libusb_transfer *transfer)
transfer->actual_length,
((float)stransfer->recording->sample_count) /
stransfer->recording->recording_size * 100);
#if 0
if (tcounter < 2000) {
#endif
stransfer->seq = tcounter++;
ret = libusb_submit_transfer(stransfer->transfer);
if (ret) {
fprintf(stderr, "libusb_submit_transfer: %s\n",
usbutil_error_to_string(ret));
return;
}
#if 0
} else {
libusb_free_transfer(transfer);
/* free data? */
stransfer->seq = tcounter++;
ret = libusb_submit_transfer(stransfer->transfer);
if (ret) {
fprintf(stderr, "libusb_submit_transfer: %s\n",
usbutil_error_to_string(ret));
return;
}
#endif
}

/*
Expand Down Expand Up @@ -370,8 +334,8 @@ int slogic_read_samples(struct slogic_handle *handle,
for (counter = 0; counter < recording->n_transfer_buffers; counter++) {
recording->transfers[counter].seq = tcounter++;
ret =
libusb_submit_transfer(recording->transfers[counter].
transfer);
libusb_submit_transfer(recording->
transfers[counter].transfer);
if (ret) {
fprintf(stderr, "libusb_submit_transfer: %s\n",
usbutil_error_to_string(ret));
Expand Down

0 comments on commit ce5dd66

Please sign in to comment.