mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +00:00
Add a connection_type attribute to each programmer, rather than
trying to hard-code the default port name in main.c. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@1047 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
@@ -375,7 +375,7 @@ int main(int argc, char * argv [])
|
||||
}
|
||||
|
||||
partdesc = NULL;
|
||||
port = default_parallel;
|
||||
port = NULL;
|
||||
erase = 0;
|
||||
calibrate = 0;
|
||||
auto_erase = 1;
|
||||
@@ -763,16 +763,23 @@ int main(int argc, char * argv [])
|
||||
}
|
||||
}
|
||||
|
||||
if ((strcmp(pgm->type, "STK500") == 0) ||
|
||||
(strcmp(pgm->type, "avr910") == 0) ||
|
||||
(strcmp(pgm->type, "BusPirate") == 0) ||
|
||||
(strcmp(pgm->type, "STK500V2") == 0) ||
|
||||
(strcmp(pgm->type, "JTAGMKII") == 0)) {
|
||||
if (port == default_parallel) {
|
||||
port = default_serial;
|
||||
if (port == NULL) {
|
||||
switch (pgm->conntype)
|
||||
{
|
||||
case CONNTYPE_PARALLEL:
|
||||
port = default_parallel;
|
||||
break;
|
||||
|
||||
case CONNTYPE_SERIAL:
|
||||
port = default_serial;
|
||||
break;
|
||||
|
||||
case CONNTYPE_USB:
|
||||
port = DEFAULT_USB;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (partdesc == NULL) {
|
||||
fprintf(stderr,
|
||||
"%s: No AVR part has been specified, use \"-p Part\"\n\n",
|
||||
|
||||
Reference in New Issue
Block a user