File tree 2 files changed +471
-419
lines changed
hardware/arduino/bootloaders/stk500v2
2 files changed +471
-419
lines changed Original file line number Diff line number Diff line change @@ -1020,24 +1020,15 @@ int main(void)
1020
1020
}
1021
1021
else
1022
1022
{
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.
1025
1024
uint16_t ii = address >> 1 ;
1026
1025
/* 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 ++ );
1030
1028
address += 2 ; // Select next EEPROM byte
1031
1029
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
+ }
1041
1032
}
1042
1033
msgLength = 2 ;
1043
1034
msgBuffer [1 ] = STATUS_CMD_OK ;
You can’t perform that action at this time.
0 commit comments