mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
Mega-commit to bring in memory tagging.
Each memory image byte is now tagged as it's being read from a file. Only bytes read from a file will be written or verified (modulo page granularity requirements). git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1007 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
19
usbtiny.c
19
usbtiny.c
@@ -423,9 +423,10 @@ static void usbtiny_disable ( PROGRAMMER* pgm ) {}
|
||||
* per byte
|
||||
*/
|
||||
static int usbtiny_paged_load (PROGRAMMER * pgm, AVRPART * p, AVRMEM* m,
|
||||
int page_size, int n_bytes )
|
||||
unsigned int page_size,
|
||||
unsigned int i, unsigned int n_bytes)
|
||||
{
|
||||
int i;
|
||||
unsigned int maxaddr = i + n_bytes;
|
||||
int chunk;
|
||||
int function;
|
||||
|
||||
@@ -437,7 +438,7 @@ static int usbtiny_paged_load (PROGRAMMER * pgm, AVRPART * p, AVRMEM* m,
|
||||
function = USBTINY_EEPROM_READ;
|
||||
}
|
||||
|
||||
for (i = 0; i < n_bytes; i += chunk) {
|
||||
for (; i < maxaddr; i += chunk) {
|
||||
chunk = PDATA(pgm)->chunk_size; // start with the maximum chunk size possible
|
||||
|
||||
// If we want to xmit less than a chunk, thats OK
|
||||
@@ -457,9 +458,6 @@ static int usbtiny_paged_load (PROGRAMMER * pgm, AVRPART * p, AVRMEM* m,
|
||||
// usb_in() multiplies this per byte.
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Tell avrdude how we're doing to provide user feedback
|
||||
report_progress(i + chunk, n_bytes, NULL );
|
||||
}
|
||||
|
||||
check_retries(pgm, "read");
|
||||
@@ -472,9 +470,10 @@ static int usbtiny_paged_load (PROGRAMMER * pgm, AVRPART * p, AVRMEM* m,
|
||||
* per byte.
|
||||
*/
|
||||
static int usbtiny_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
int page_size, int n_bytes)
|
||||
unsigned int page_size,
|
||||
unsigned int i, unsigned int n_bytes)
|
||||
{
|
||||
int i;
|
||||
unsigned int maxaddr = i + n_bytes;
|
||||
int chunk; // Size of data to write at once
|
||||
int next;
|
||||
int function; // which SPI command to use
|
||||
@@ -496,7 +495,7 @@ static int usbtiny_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
delay = m->max_write_delay;
|
||||
}
|
||||
|
||||
for (i=0; i < n_bytes; i=next) {
|
||||
for (; i < maxaddr; i=next) {
|
||||
// start with the max chunk size
|
||||
chunk = PDATA(pgm)->chunk_size;
|
||||
|
||||
@@ -527,8 +526,6 @@ static int usbtiny_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
// If we're at a page boundary, send the SPI command to flush it.
|
||||
avr_write_page(pgm, p, m, (unsigned long) i);
|
||||
}
|
||||
|
||||
report_progress( next, n_bytes, NULL );
|
||||
}
|
||||
return n_bytes;
|
||||
}
|
||||
|
Reference in New Issue
Block a user