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:
Joerg Wunsch
2021-11-27 17:33:49 +00:00
parent 18fe8ef834
commit dd1255b0c8
6 changed files with 59 additions and 31 deletions

View File

@@ -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, ":");