File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1021,13 +1021,14 @@ int main(void)
1021
1021
else
1022
1022
{
1023
1023
//* issue 543, this should work, It has not been tested.
1024
- // #if (! defined(__AVR_ATmega1280__ ) && ! defined(__AVR_ATmega2560__ ) && ! defined(__AVR_ATmega2561__ ) && ! defined(__AVR_ATmega1284P__ ) && ! defined(__AVR_ATmega640__ ))
1025
- #if (defined( EEARL ) && defined( EEARH ) && defined( EEMWE ) && defined( EEWE ) && defined( EEDR ))
1024
+ #if (defined(EEARL ) && defined(EEARH ) && defined(EEMWE ) && defined(EEWE ) && defined(EEDR ))
1025
+ uint16_t ii = address >> 1 ;
1026
1026
/* write EEPROM */
1027
1027
do {
1028
- EEARL = address ; // Setup EEPROM address
1029
- EEARH = (address >> 8 );
1030
- address ++ ; // Select next EEPROM byte
1028
+ EEARL = ii ; // Setup EEPROM address
1029
+ EEARH = (ii >> 8 );
1030
+ address += 2 ; // Select next EEPROM byte
1031
+ ii ++ ;
1031
1032
1032
1033
EEDR = * p ++ ; // get byte from buffer
1033
1034
EECR |= (1 <<EEMWE ); // Write data into EEPROM
@@ -1036,9 +1037,9 @@ int main(void)
1036
1037
while (EECR & (1 <<EEWE )); // Wait for write operation to finish
1037
1038
size -- ; // Decrease number of bytes to write
1038
1039
} while (size ); // Loop until all bytes written
1039
- #endif
1040
+ #endif
1040
1041
}
1041
- msgLength = 2 ;
1042
+ msgLength = 2 ;
1042
1043
msgBuffer [1 ] = STATUS_CMD_OK ;
1043
1044
}
1044
1045
break ;
You can’t perform that action at this time.
0 commit comments