Various fixes/updates to make the driver compile.

This patchset was originally done by eightdot <gituser@eightdot.eu> by
manually forward-porting parts of the changes done by Bert Vermeulen (see
previous commits), but then heavily modified by Uwe Hermann to be based on
top off the (git-)rebased patches from Bert Vermeulen instead.

Note: This initial DSLogic code is *not* yet in a working or usable
state. It should be considered as a basis for further work only, for now.
This commit is contained in:
eightdot 2015-03-16 10:34:08 +01:00 committed by Uwe Hermann
parent b9d530920f
commit 6fcf3f0a22
4 changed files with 18 additions and 22 deletions

View File

@ -626,7 +626,6 @@ static int start_transfers(const struct sr_dev_inst *sdi)
devc = sdi->priv;
usb = sdi->conn;
devc->cb_data = cb_data;
devc->sent_samples = 0;
devc->acq_aborted = FALSE;
devc->empty_transfer_count = 0;
@ -679,9 +678,7 @@ static int start_transfers(const struct sr_dev_inst *sdi)
}
/* Send header packet to the session bus. */
std_session_send_df_header(devc->cb_data, LOG_PREFIX);
usb_source_add(sdi->session, devc->ctx, timeout, receive_data, NULL);
std_session_send_df_header(sdi, LOG_PREFIX);
return SR_OK;
}
@ -751,12 +748,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
drvc = di->priv;
devc = sdi->priv;
/* Configures devc->trigger_* and devc->sample_wide */
if (fx2lafw_configure_channels(sdi) != SR_OK) {
sr_err("Failed to configure channels.");
return SR_ERR;
}
devc->ctx = drvc->sr_ctx;
devc->cb_data = cb_data;
devc->sent_samples = 0;
@ -764,7 +755,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
devc->acq_aborted = FALSE;
timeout = fx2lafw_get_timeout(devc);
usb_source_add(devc->ctx, timeout, receive_data, NULL);
usb_source_add(sdi->session, devc->ctx, timeout, receive_data, NULL);
if (devc->dslogic) {
dslogic_trigger_request(sdi);

View File

@ -18,6 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_HARDWARE_FX2LAFW_DSLOGIC_H
#define LIBSIGROK_HARDWARE_FX2LAFW_DSLOGIC_H
/* Modified protocol commands & flags used by DSLogic */
#define DS_CMD_GET_FW_VERSION 0xb0
#define DS_CMD_GET_REVID_VERSION 0xb1
@ -120,9 +123,10 @@ struct dslogic_fpga_config {
uint32_t end_sync;
};
int dslogic_fpga_firmware_upload(const struct sr_dev_inst *sdi,
const char *filename);
int dslogic_start_acquisition(const struct sr_dev_inst *sdi);
int dslogic_stop_acquisition(const struct sr_dev_inst *sdi);
int dslogic_fpga_configure(const struct sr_dev_inst *sdi);
#endif

View File

@ -133,4 +133,5 @@ SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer);
SR_PRIV size_t fx2lafw_get_buffer_size(struct dev_context *devc);
SR_PRIV unsigned int fx2lafw_get_number_of_transfers(struct dev_context *devc);
SR_PRIV unsigned int fx2lafw_get_timeout(struct dev_context *devc);
#endif