diff options
| author | Nick Brassel <nick@tzarc.org> | 2019-11-06 08:04:50 +1100 |
|---|---|---|
| committer | Nick Brassel <nick@tzarc.org> | 2020-01-24 12:45:58 +1100 |
| commit | d13ada11622977bcc0b530212b4405229805016d (patch) | |
| tree | 3f8874ac3c9b5950b1fed6ac4d0081a268d9f487 /quantum/rgblight.c | |
| parent | 6ff093efbee21d3f64f5b4bfdbc66d4648490523 (diff) | |
| download | qmk_firmware-d13ada11622977bcc0b530212b4405229805016d.tar.gz qmk_firmware-d13ada11622977bcc0b530212b4405229805016d.zip | |
Add customisable EEPROM driver selection (#7274)
- uprintf -> dprintf
- Fix atsam "vendor" eeprom.
- Bump Kinetis K20x to 64 bytes, too.
- Rollback Kinetis to 32 bytes as partitioning can only be done once. Add warning about changing the value.
- Change RAM-backed "fake" EEPROM implementations to match eeconfig's current usage.
- Add 24LC128 by request.
Diffstat (limited to 'quantum/rgblight.c')
| -rw-r--r-- | quantum/rgblight.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 40de19eac..67d601af7 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -19,9 +19,11 @@ | |||
| 19 | # include <avr/eeprom.h> | 19 | # include <avr/eeprom.h> |
| 20 | # include <avr/interrupt.h> | 20 | # include <avr/interrupt.h> |
| 21 | #endif | 21 | #endif |
| 22 | #ifdef EEPROM_ENABLE | ||
| 23 | # include "eeprom.h" | ||
| 24 | #endif | ||
| 22 | #ifdef STM32_EEPROM_ENABLE | 25 | #ifdef STM32_EEPROM_ENABLE |
| 23 | # include "hal.h" | 26 | # include "hal.h" |
| 24 | # include "eeprom.h" | ||
| 25 | # include "eeprom_stm32.h" | 27 | # include "eeprom_stm32.h" |
| 26 | #endif | 28 | #endif |
| 27 | #include "wait.h" | 29 | #include "wait.h" |
| @@ -146,7 +148,7 @@ void rgblight_check_config(void) { | |||
| 146 | } | 148 | } |
| 147 | 149 | ||
| 148 | uint32_t eeconfig_read_rgblight(void) { | 150 | uint32_t eeconfig_read_rgblight(void) { |
| 149 | #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) | 151 | #ifdef EEPROM_ENABLE |
| 150 | return eeprom_read_dword(EECONFIG_RGBLIGHT); | 152 | return eeprom_read_dword(EECONFIG_RGBLIGHT); |
| 151 | #else | 153 | #else |
| 152 | return 0; | 154 | return 0; |
| @@ -154,7 +156,7 @@ uint32_t eeconfig_read_rgblight(void) { | |||
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | void eeconfig_update_rgblight(uint32_t val) { | 158 | void eeconfig_update_rgblight(uint32_t val) { |
| 157 | #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) | 159 | #ifdef EEPROM_ENABLE |
| 158 | rgblight_check_config(); | 160 | rgblight_check_config(); |
| 159 | eeprom_update_dword(EECONFIG_RGBLIGHT, val); | 161 | eeprom_update_dword(EECONFIG_RGBLIGHT, val); |
| 160 | #endif | 162 | #endif |
