diff options
| author | Andrew Kannan <andrew.kannan@klaviyo.com> | 2019-01-28 19:40:02 -0500 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-01-28 16:40:02 -0800 |
| commit | 0f507f01696eae0e8fe808d17a19db3f6d9e2ce4 (patch) | |
| tree | 986c78fbb09b6bf5e33df6c28158e6877af64960 /quantum/rgblight.c | |
| parent | d9120412d3d81fc688a7e5346711cf716518dc34 (diff) | |
| download | qmk_firmware-0f507f01696eae0e8fe808d17a19db3f6d9e2ce4.tar.gz qmk_firmware-0f507f01696eae0e8fe808d17a19db3f6d9e2ce4.zip | |
Practice60 RGB and PWM Backlight (#4929)
* Update Practice60 to enable RGB via SPI DMA and use PWM backlight breathing
* Correct stm32f103c8t6 flash size in eeprom definition
* Remove unused files and improve ifdef checks
* Update quantum/rgblight.c
Co-Authored-By: awkannan <andrew.kannan@klaviyo.com>
* Update quantum/rgblight.c
Co-Authored-By: awkannan <andrew.kannan@klaviyo.com>
* EEPROM implementation fix and updated p60 code
* Update define
* Remove dead code
* Update keymap to remove test key
* Update keymap again
Diffstat (limited to 'quantum/rgblight.c')
| -rw-r--r-- | quantum/rgblight.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index cf2666eb4..22dce963c 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -19,6 +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 STM32_EEPROM_ENABLE | ||
| 23 | #include "hal.h" | ||
| 24 | #include "eeprom.h" | ||
| 25 | #include "eeprom_stm32.h" | ||
| 26 | #endif | ||
| 22 | #include "wait.h" | 27 | #include "wait.h" |
| 23 | #include "progmem.h" | 28 | #include "progmem.h" |
| 24 | #include "timer.h" | 29 | #include "timer.h" |
| @@ -120,14 +125,14 @@ void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1) { | |||
| 120 | 125 | ||
| 121 | 126 | ||
| 122 | uint32_t eeconfig_read_rgblight(void) { | 127 | uint32_t eeconfig_read_rgblight(void) { |
| 123 | #ifdef __AVR__ | 128 | #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) |
| 124 | return eeprom_read_dword(EECONFIG_RGBLIGHT); | 129 | return eeprom_read_dword(EECONFIG_RGBLIGHT); |
| 125 | #else | 130 | #else |
| 126 | return 0; | 131 | return 0; |
| 127 | #endif | 132 | #endif |
| 128 | } | 133 | } |
| 129 | void eeconfig_update_rgblight(uint32_t val) { | 134 | void eeconfig_update_rgblight(uint32_t val) { |
| 130 | #ifdef __AVR__ | 135 | #if defined(__AVR__) || defined(STM32_EEPROM_ENABLE) || defined(PROTOCOL_ARM_ATSAM) || defined(EEPROM_SIZE) |
| 131 | if (eeconfig_read_rgblight() != val) { | 136 | if (eeconfig_read_rgblight() != val) { |
| 132 | eeprom_update_dword(EECONFIG_RGBLIGHT, val); | 137 | eeprom_update_dword(EECONFIG_RGBLIGHT, val); |
| 133 | } | 138 | } |
| @@ -333,7 +338,7 @@ void rgblight_disable_noeeprom(void) { | |||
| 333 | #ifdef RGBLIGHT_USE_TIMER | 338 | #ifdef RGBLIGHT_USE_TIMER |
| 334 | rgblight_timer_disable(); | 339 | rgblight_timer_disable(); |
| 335 | #endif | 340 | #endif |
| 336 | _delay_ms(50); | 341 | wait_ms(50); |
| 337 | rgblight_set(); | 342 | rgblight_set(); |
| 338 | } | 343 | } |
| 339 | 344 | ||
