mirror of
https://github.com/trabucayre/openFPGALoader.git
synced 2026-09-01 02:28:53 +02:00
add option to enable/disable udev support
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#ifdef USE_UDEV
|
||||
#include <libudev.h>
|
||||
#endif
|
||||
#include <libusb.h>
|
||||
|
||||
#include "ftdipp_mpsse.hpp"
|
||||
@@ -346,6 +348,7 @@ int FTDIpp_MPSSE::mpsse_read(unsigned char *rx_buff, int len)
|
||||
return num_read;
|
||||
}
|
||||
|
||||
#ifdef USE_UDEV
|
||||
unsigned int FTDIpp_MPSSE::udevstufftoint(const char *udevstring, int base)
|
||||
{
|
||||
char *endp;
|
||||
@@ -436,3 +439,16 @@ bool FTDIpp_MPSSE::search_with_dev(const string &device)
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
unsigned int FTDIpp_MPSSE::udevstufftoint(const char *udevstring, int base)
|
||||
{
|
||||
(void)udevstring;
|
||||
(void)base;
|
||||
return 0;
|
||||
}
|
||||
bool FTDIpp_MPSSE::search_with_dev(const string &device)
|
||||
{
|
||||
(void)device;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,9 @@ static struct argp_option options[] = {
|
||||
{"list-cables", LIST_CABLE, 0, 0, "list all supported cables"},
|
||||
{"board", 'b', "BOARD", 0, "board name, may be used instead of cable"},
|
||||
{"list-boards", LIST_BOARD, 0, 0, "list all supported boards"},
|
||||
#ifdef USE_UDEV
|
||||
{"device", 'd', "DEVICE", 0, "device to use (/dev/ttyUSBx)"},
|
||||
#endif
|
||||
{"list-fpga", LIST_FPGA, 0, 0, "list all supported FPGA"},
|
||||
{"detect", DETECT, 0, 0, "detect FPGA"},
|
||||
{"write-flash", 'f', 0, 0,
|
||||
@@ -215,9 +217,11 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
|
||||
case 'r':
|
||||
arguments->reset = true;
|
||||
break;
|
||||
#ifdef USE_UDEV
|
||||
case 'd':
|
||||
arguments->device = arg;
|
||||
break;
|
||||
#endif
|
||||
case 'v':
|
||||
arguments->verbose = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user