diff options
| author | Andrew Kannan <andrew.kannan@klaviyo.com> | 2019-01-29 23:04:20 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-01-29 20:04:20 -0800 |
| commit | 7186d1581abbd97d7c76626ae83fc866e85d217c (patch) | |
| tree | 1a6cf65f38f00f48e1539a8c01418cf770119a37 /tmk_core | |
| parent | 74fcfd533508d5743a20a7cd7faba404f8fc7cd3 (diff) | |
| download | qmk_firmware-7186d1581abbd97d7c76626ae83fc866e85d217c.tar.gz qmk_firmware-7186d1581abbd97d7c76626ae83fc866e85d217c.zip | |
Moving cannonkeys boards to one place, eeprom fix (#4999)
* Move boards to cannonkeys and share resources
* Share common files between cannonkey boards
* Fix ortho60 keymap
* update LED numbers
* Add RGB keys to Ortho60 and Ortho48
* Add Backlight control to default layout Ortho60 and 48
* Remove unnecessary ws2812.c SRC from rules.mk
Diffstat (limited to 'tmk_core')
| -rwxr-xr-x | tmk_core/common/chibios/eeprom_stm32.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/tmk_core/common/chibios/eeprom_stm32.c index 17d38af6a..4b1abc968 100755 --- a/tmk_core/common/chibios/eeprom_stm32.c +++ b/tmk_core/common/chibios/eeprom_stm32.c | |||
| @@ -179,10 +179,14 @@ void eeprom_write_dword (uint32_t *Address, uint32_t Value) | |||
| 179 | void eeprom_update_dword (uint32_t *Address, uint32_t Value) | 179 | void eeprom_update_dword (uint32_t *Address, uint32_t Value) |
| 180 | { | 180 | { |
| 181 | uint16_t p = (const uint32_t) Address; | 181 | uint16_t p = (const uint32_t) Address; |
| 182 | EEPROM_WriteDataByte(p, (uint8_t) Value); | 182 | uint32_t existingValue = EEPROM_ReadDataByte(p) | (EEPROM_ReadDataByte(p+1) << 8) |
| 183 | EEPROM_WriteDataByte(p+1, (uint8_t) (Value >> 8)); | 183 | | (EEPROM_ReadDataByte(p+2) << 16) | (EEPROM_ReadDataByte(p+3) << 24); |
| 184 | EEPROM_WriteDataByte(p+2, (uint8_t) (Value >> 16)); | 184 | if(Value != existingValue){ |
| 185 | EEPROM_WriteDataByte(p+3, (uint8_t) (Value >> 24)); | 185 | EEPROM_WriteDataByte(p, (uint8_t) Value); |
| 186 | EEPROM_WriteDataByte(p+1, (uint8_t) (Value >> 8)); | ||
| 187 | EEPROM_WriteDataByte(p+2, (uint8_t) (Value >> 16)); | ||
| 188 | EEPROM_WriteDataByte(p+3, (uint8_t) (Value >> 24)); | ||
| 189 | } | ||
| 186 | } | 190 | } |
| 187 | 191 | ||
| 188 | void eeprom_read_block(void *buf, const void *addr, uint32_t len) { | 192 | void eeprom_read_block(void *buf, const void *addr, uint32_t len) { |
