mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
FTDI support: try ftdi_open first if the device name is 'ftdi'
It makes no sense to have the OS try (and fail) to open that device name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b7619553fd
commit
5377706aca
1 changed files with 4 additions and 4 deletions
|
@ -1308,10 +1308,6 @@ dc_status_t divecomputer_device_open(device_data_t *data)
|
|||
return DC_STATUS_SUCCESS;
|
||||
|
||||
if (transports & DC_TRANSPORT_SERIAL) {
|
||||
rc = dc_serial_open(&data->iostream, context, data->devname);
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
return rc;
|
||||
|
||||
#ifdef SERIAL_FTDI
|
||||
if (!strcmp(data->devname, "ftdi")) {
|
||||
rc = ftdi_open(&data->iostream, context);
|
||||
|
@ -1319,6 +1315,10 @@ dc_status_t divecomputer_device_open(device_data_t *data)
|
|||
return rc;
|
||||
}
|
||||
#endif
|
||||
rc = dc_serial_open(&data->iostream, context, data->devname);
|
||||
if (rc == DC_STATUS_SUCCESS)
|
||||
return rc;
|
||||
|
||||
}
|
||||
|
||||
if (transports & DC_TRANSPORT_IRDA) {
|
||||
|
|
Loading…
Add table
Reference in a new issue