Use lex/yacc for parsing the config file. Re-work the config file

format using a more human-readable format.

Read part descriptions from the config file now instead of hard-coding
them.

Update usage().

Cleanup unused code.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@79 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2001-10-14 23:17:26 +00:00
parent 3bae0d8d14
commit 3d8f8bcd45
14 changed files with 2900 additions and 541 deletions

68
avr.h
View File

@@ -45,15 +45,6 @@
#define AVR_MAXMEMTYPES 2 /* just flash and eeprom */
#if 0
struct avrmem {
int startaddr;
int size;
unsigned char * buf;
struct avrmem * next;
};
#endif
typedef struct avrmem {
int banked; /* bank addressed (e.g. ATmega flash) */
int size; /* total memory size in bytes */
@@ -66,42 +57,27 @@ typedef struct avrmem {
} AVRMEM;
struct avrpart {
char * partdesc; /* long part name */
char * optiontag; /* short part name */
#define AVR_DESCLEN 64
#define AVR_IDLEN 32
typedef struct avrpart {
char desc[AVR_DESCLEN]; /* long part name */
char id[AVR_IDLEN]; /* short part name */
int chip_erase_delay; /* microseconds */
AVRMEM mem[AVR_MAXMEMTYPES];
#if 0
int memsize[AVR_MAXMEMTYPES]; /* sizes for eeprom,
flash, etc, indexed by
AVR_EEPROM or AVR_FLASH */
unsigned char f_readback; /* flash write polled readback value */
unsigned char e_readback[2]; /* eeprom write polled readback values */
int min_write_delay; /* microseconds */
int max_write_delay; /* microseconds */
#if 1
unsigned char * mem[AVR_MAXMEMTYPES]; /* pointers to avr memory
buffers, indexed by
AVR_EEPROM or AVR_FLASH */
#else
struct avrmem * mem[AVR_MAXMEMTYPES]; /* pointers to avr memory
buffers, indexed by
AVR_EEPROM or AVR_FLASH */
#endif
#endif
};
} AVRPART;
extern struct avrpart parts[];
int avr_list_parts(FILE * f, char * prefix);
AVRPART * avr_find_part(char * p);
struct avrpart * avr_find_part(char * p);
AVRPART * avr_new_part(void);
AVRPART * avr_dup_part(AVRPART * d);
int avr_txrx_bit(int fd, int bit);
@@ -109,22 +85,22 @@ unsigned char avr_txrx(int fd, unsigned char byte);
int avr_cmd(int fd, unsigned char cmd[4], unsigned char res[4]);
unsigned char avr_read_byte(int fd, struct avrpart * p,
int memtype, unsigned long addr);
unsigned char avr_read_byte(int fd, AVRPART * p,
int memtype, unsigned long addr);
int avr_read(int fd, struct avrpart * p, int memtype);
int avr_read(int fd, AVRPART * p, int memtype);
int avr_write_bank(int fd, struct avrpart * p, int memtype,
int avr_write_bank(int fd, AVRPART * p, int memtype,
unsigned short bank);
int avr_write_byte(int fd, struct avrpart * p, int memtype,
unsigned long addr, unsigned char data);
int avr_write_byte(int fd, AVRPART * p, int memtype,
unsigned long addr, unsigned char data);
int avr_write(int fd, struct avrpart * p, int memtype, int size);
int avr_write(int fd, AVRPART * p, int memtype, int size);
int avr_program_enable(int fd);
int avr_chip_erase(int fd, struct avrpart * p);
int avr_chip_erase(int fd, AVRPART * p);
int avr_signature(int fd, unsigned char sig[4]);
@@ -132,16 +108,16 @@ void avr_powerup(int fd);
void avr_powerdown(int fd);
int avr_initialize(int fd, struct avrpart * p);
int avr_initialize(int fd, AVRPART * p);
char * avr_memtstr(int memtype);
int avr_initmem(struct avrpart * p);
int avr_initmem(AVRPART * p);
int avr_verify(struct avrpart * p, struct avrpart * v, int memtype,
int avr_verify(AVRPART * p, AVRPART * v, int memtype,
int size);
void avr_display(FILE * f, struct avrpart * p, char * prefix);
void avr_display(FILE * f, AVRPART * p, char * prefix);
#endif