mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-07 00:42:50 +00:00
Merge pull request #84 from eltang/eeprom_wear_fix
Update functions used to write to EEPROM (thanks to Eric Tang).
This commit is contained in:
commit
fe1c241ff7
@ -360,7 +360,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Write the next EEPROM byte from the endpoint */
|
/* Write the next EEPROM byte from the endpoint */
|
||||||
eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
|
eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
|
||||||
|
|
||||||
/* Increment the address counter after use */
|
/* Increment the address counter after use */
|
||||||
CurrAddress += 2;
|
CurrAddress += 2;
|
||||||
@ -614,7 +614,7 @@ static void CDC_Task(void)
|
|||||||
else if (Command == AVR109_COMMAND_WriteEEPROM)
|
else if (Command == AVR109_COMMAND_WriteEEPROM)
|
||||||
{
|
{
|
||||||
/* Read the byte from the endpoint and write it to the EEPROM */
|
/* Read the byte from the endpoint and write it to the EEPROM */
|
||||||
eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
|
eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
|
||||||
|
|
||||||
/* Increment the address after use */
|
/* Increment the address after use */
|
||||||
CurrAddress += 2;
|
CurrAddress += 2;
|
||||||
@ -671,4 +671,3 @@ static void CDC_Task(void)
|
|||||||
/* Acknowledge the command from the host */
|
/* Acknowledge the command from the host */
|
||||||
Endpoint_ClearOUT();
|
Endpoint_ClearOUT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ void EVENT_USB_Device_ControlRequest(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read the byte from the USB interface and write to to the EEPROM */
|
/* Read the byte from the USB interface and write to to the EEPROM */
|
||||||
eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_8());
|
eeprom_update_byte((uint8_t*)StartAddr, Endpoint_Read_8());
|
||||||
|
|
||||||
/* Adjust counters */
|
/* Adjust counters */
|
||||||
StartAddr++;
|
StartAddr++;
|
||||||
@ -857,4 +857,3 @@ static void ProcessReadCommand(void)
|
|||||||
DFU_Status = errADDRESS;
|
DFU_Status = errADDRESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user