mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 02:31:06 +00:00
Improve defaults and documentation of linuxspi
* avrdude.conf.in: use @HAVE_LINUXGPIO_BEGIN/END@ and @HAVE_LINUXSPI_BEGIN/END@ brackets around respective config snippets; values were already set in configure.ac. * linuxspi.c (linuxspi_open): Provide a reasonable (for the Raspberry Pi) default for the -P option * avrdude.1: Extend linuxspi documentation * doc/avrdude.texi: (Dito.) git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1496 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
10
linuxspi.c
10
linuxspi.c
@@ -131,14 +131,16 @@ static int linuxspi_reset_mcu(PROGRAMMER *pgm, bool active)
|
||||
|
||||
static int linuxspi_open(PROGRAMMER *pgm, char *port)
|
||||
{
|
||||
const char *port_error = "%s: error: Unknown port specification. Please use the format /dev/spidev:/dev/gpiochip[:resetno]\n";
|
||||
const char *port_error =
|
||||
"%s: error: Unknown port specification. "
|
||||
"Please use the format /dev/spidev:/dev/gpiochip[:resetno]\n";
|
||||
char port_default[] = "/dev/spidev0.0:/dev/gpiochip0";
|
||||
char *spidev, *gpiochip, *reset_pin;
|
||||
struct gpiohandle_request req;
|
||||
int ret;
|
||||
|
||||
if (!port || !strcmp(port, "unknown")) {
|
||||
avrdude_message(MSG_INFO, "%s: error: No port specified. Port should point to an spidev device.\n", progname);
|
||||
return -1;
|
||||
if (!strcmp(port, "unknown")) {
|
||||
port = port_default;
|
||||
}
|
||||
|
||||
spidev = strtok(port, ":");
|
||||
|
||||
Reference in New Issue
Block a user