mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-28 06:55:27 +00:00
Makefile : use gzip -f for man page installation so that we don't get
prompted. avr.c avr.h fileio.c term.c : Change the avrpart data structure so that the typedef AVRMEM is used as an index into an array for the sizes of the memory types and also for pointers to buffers that represent the chip data for that memory type. This removes a lot of conditional code of the form: switch (memtype) { case AVR_FLASH : ... } Also, re-code avr_read_byte() and avr_write_byte() to properly handle the flash memory type without having to tell them whether they should program the high byte or the low byte - figure that out from the address itself. For flash memory type, these routines now take the actual byte address instead of the word address. This _greatly_ simplifies many otherwise simple operations, such a reading or writing a range of memory, by not having to worry about whether the address starts on an odd byte or an even byte. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@45 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
28
avr.h
28
avr.h
@@ -45,27 +45,47 @@
|
||||
|
||||
|
||||
/*
|
||||
* AVR memory designations
|
||||
* AVR memory designations; the order of these is important, these are
|
||||
* used as indexes into statically initialized data, don't change them
|
||||
* around.
|
||||
*/
|
||||
typedef enum {
|
||||
AVR_EEPROM,
|
||||
AVR_FLASH,
|
||||
AVR_FLASH_LO,
|
||||
AVR_FLASH_HI
|
||||
AVR_FLASH
|
||||
} AVRMEM;
|
||||
|
||||
#define AVR_MAXMEMTYPES 2 /* just flash and eeprom */
|
||||
|
||||
#if 0
|
||||
struct avrmem {
|
||||
AVRMEM memtype;
|
||||
int startaddr;
|
||||
int size;
|
||||
unsigned char buf;
|
||||
struct avrmem * next;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct avrpart {
|
||||
char * partdesc; /* long part name */
|
||||
char * optiontag; /* short part name */
|
||||
int memsize[AVR_MAXMEMTYPES]; /* sizes for eeprom,
|
||||
flash, etc, indexed by
|
||||
AVR_EEPROM or AVR_FLASH */
|
||||
#if 0
|
||||
int flash_size; /* size in bytes of flash */
|
||||
int eeprom_size; /* size in bytes of eeprom */
|
||||
#endif
|
||||
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 */
|
||||
int chip_erase_delay; /* microseconds */
|
||||
unsigned char * mem[AVR_MAXMEMTYPES];
|
||||
#if 0
|
||||
unsigned char * flash;
|
||||
unsigned char * eeprom;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct avrpart parts[];
|
||||
|
Reference in New Issue
Block a user