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:
Joerg Wunsch
2012-01-30 17:08:48 +00:00
parent a3ac01c572
commit 793591c158
8 changed files with 130 additions and 17 deletions

View File

@@ -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",