File tree Expand file tree Collapse file tree 2 files changed +471
-419
lines changed
hardware/arduino/bootloaders/stk500v2 Expand file tree Collapse file tree 2 files changed +471
-419
lines changed Original file line number Diff line number Diff line change @@ -1020,24 +1020,15 @@ int main(void)
10201020 }
10211021 else
10221022 {
1023- //* issue 543, this should work, It has not been tested.
1024- #if (defined(EEARL ) && defined(EEARH ) && defined(EEMWE ) && defined(EEWE ) && defined(EEDR ))
1023+ //* issue 543, this should work, It has not been tested.
10251024 uint16_t ii = address >> 1 ;
10261025 /* write EEPROM */
1027- do {
1028- EEARL = ii ; // Setup EEPROM address
1029- EEARH = (ii >> 8 );
1026+ while (size ) {
1027+ eeprom_write_byte ((uint8_t * )ii , * p ++ );
10301028 address += 2 ; // Select next EEPROM byte
10311029 ii ++ ;
1032-
1033- EEDR = * p ++ ; // get byte from buffer
1034- EECR |= (1 <<EEMWE ); // Write data into EEPROM
1035- EECR |= (1 <<EEWE );
1036-
1037- while (EECR & (1 <<EEWE )); // Wait for write operation to finish
1038- size -- ; // Decrease number of bytes to write
1039- } while (size ); // Loop until all bytes written
1040- #endif
1030+ size -- ;
1031+ }
10411032 }
10421033 msgLength = 2 ;
10431034 msgBuffer [1 ] = STATUS_CMD_OK ;
You can’t perform that action at this time.
0 commit comments