mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-28 23:15:27 +00:00
Commit changes in preparation for support the ATMega line.
git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@76 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
16
term.c
16
term.c
@@ -204,7 +204,7 @@ int cmd_dump ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
int i, l;
|
||||
char * buf;
|
||||
int maxsize;
|
||||
static AVRMEM memtype=AVR_FLASH;
|
||||
static int memtype=AVR_M_FLASH;
|
||||
static unsigned short addr=0;
|
||||
static int len=64;
|
||||
|
||||
@@ -219,10 +219,10 @@ int cmd_dump ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
|
||||
l = strlen(argv[1]);
|
||||
if (strncasecmp(argv[1],"flash",l)==0) {
|
||||
memtype = AVR_FLASH;
|
||||
memtype = AVR_M_FLASH;
|
||||
}
|
||||
else if (strncasecmp(argv[1],"eeprom",l)==0) {
|
||||
memtype = AVR_EEPROM;
|
||||
memtype = AVR_M_EEPROM;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "%s (dump): invalid memory type \"%s\"\n",
|
||||
@@ -247,7 +247,7 @@ int cmd_dump ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
}
|
||||
}
|
||||
|
||||
maxsize = p->memsize[memtype];
|
||||
maxsize = p->mem[memtype].size;
|
||||
|
||||
if (argc == 2) {
|
||||
addr = 0;
|
||||
@@ -288,7 +288,7 @@ int cmd_write ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
char * e;
|
||||
int i, l;
|
||||
int len, maxsize;
|
||||
AVRMEM memtype;
|
||||
int memtype;
|
||||
unsigned short addr;
|
||||
char * buf;
|
||||
int rc;
|
||||
@@ -302,10 +302,10 @@ int cmd_write ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
|
||||
l = strlen(argv[1]);
|
||||
if (strncasecmp(argv[1],"flash",l)==0) {
|
||||
memtype = AVR_FLASH;
|
||||
memtype = AVR_M_FLASH;
|
||||
}
|
||||
else if (strncasecmp(argv[1],"eeprom",l)==0) {
|
||||
memtype = AVR_EEPROM;
|
||||
memtype = AVR_M_EEPROM;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "%s (write): invalid memory type \"%s\"\n",
|
||||
@@ -313,7 +313,7 @@ int cmd_write ( int fd, struct avrpart * p, int argc, char * argv[] )
|
||||
return -1;
|
||||
}
|
||||
|
||||
maxsize = p->memsize[memtype];
|
||||
maxsize = p->mem[memtype].size;
|
||||
|
||||
addr = strtoul(argv[2], &e, 0);
|
||||
if (*e || (e == argv[2])) {
|
||||
|
Reference in New Issue
Block a user