Merge pull request #186 from dominicgs/remove-kernel-driver

Fix issue #113 - CPLD update fails on Windows
This commit is contained in:
Michael Ossmann
2015-07-07 00:22:57 -06:00
5 changed files with 21 additions and 24 deletions

View File

@ -345,7 +345,9 @@ extern "C"
typedef enum {
TRANSCEIVER_MODE_OFF = 0,
TRANSCEIVER_MODE_RX = 1,
TRANSCEIVER_MODE_TX = 2
TRANSCEIVER_MODE_TX = 2,
TRANSCEIVER_MODE_SS = 3,
TRANSCEIVER_MODE_CPLD_UPDATE = 4
} transceiver_mode_t;
void delay(uint32_t duration);

View File

@ -99,6 +99,11 @@ usb_request_status_t usb_vendor_request_set_transceiver_mode(
set_transceiver_mode(endpoint->setup.value);
usb_transfer_schedule_ack(endpoint->in);
return USB_REQUEST_STATUS_OK;
case TRANSCEIVER_MODE_CPLD_UPDATE:
usb_endpoint_init(&usb_endpoint_bulk_out);
start_cpld_update = true;
usb_transfer_schedule_ack(endpoint->in);
return USB_REQUEST_STATUS_OK;
default:
return USB_REQUEST_STATUS_STALL;
}

View File

@ -168,13 +168,6 @@ t_wav_file_hdr wave_file_hdr =
}
};
typedef enum {
TRANSCEIVER_MODE_OFF = 0,
TRANSCEIVER_MODE_RX = 1,
TRANSCEIVER_MODE_TX = 2,
TRANSCEIVER_MODE_SS = 3
} transceiver_mode_t;
static transceiver_mode_t transceiver_mode = TRANSCEIVER_MODE_RX;
#define U64TOA_MAX_DIGIT (31)

View File

@ -907,23 +907,12 @@ int ADDCALL hackrf_cpld_write(hackrf_device* device,
{
const unsigned int chunk_size = 512;
unsigned int i;
int transferred = 0;
int result = libusb_release_interface(device->usb_device, 0);
if (result != LIBUSB_SUCCESS) {
return HACKRF_ERROR_LIBUSB;
}
result = set_hackrf_configuration(device->usb_device, USB_CONFIG_CPLD_UPDATE);
if( result != LIBUSB_SUCCESS )
{
int result, transferred = 0;
result = hackrf_set_transceiver_mode(device, TRANSCEIVER_MODE_CPLD_UPDATE);
if (result != 0)
return result;
}
result = libusb_claim_interface(device->usb_device, 0);
if (result != LIBUSB_SUCCESS) {
return HACKRF_ERROR_LIBUSB;
}
for (i = 0; i < total_length; i += chunk_size)
{
result = libusb_bulk_transfer(

View File

@ -81,6 +81,14 @@ enum rf_path_filter {
RF_PATH_FILTER_HIGH_PASS = 2,
};
typedef enum {
TRANSCEIVER_MODE_OFF = 0,
TRANSCEIVER_MODE_RX = 1,
TRANSCEIVER_MODE_TX = 2,
TRANSCEIVER_MODE_SS = 3,
TRANSCEIVER_MODE_CPLD_UPDATE = 4
} transceiver_mode_t;
typedef struct hackrf_device hackrf_device;
typedef struct {