Rework RGBLight driver system (#22529)
This commit is contained in:
parent
2acb426b8e
commit
17f36a21bf
35 changed files with 125 additions and 87 deletions
|
@ -14,10 +14,8 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dp60.h"
|
||||
|
||||
#include "rgblight.h"
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "ws2812.h"
|
||||
|
||||
// caps led
|
||||
const rgblight_segment_t PROGMEM dp60_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
|
@ -72,13 +70,17 @@ extern rgblight_config_t rgblight_config;
|
|||
extern void rgblight_layers_write(void);
|
||||
extern void indicator_write(rgb_led_t *start_led, uint8_t num_leds);
|
||||
|
||||
void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds)
|
||||
void setleds_custom(rgb_led_t *start_led, uint16_t num_leds)
|
||||
{
|
||||
ws2812_setleds(start_led, RGBLED_NUM-RGB_INDICATOR_NUM);
|
||||
|
||||
indicator_write(start_led + (RGBLED_NUM - RGB_INDICATOR_NUM), RGB_INDICATOR_NUM);
|
||||
}
|
||||
|
||||
const rgblight_driver_t rgblight_driver = {
|
||||
.setleds = setleds_custom,
|
||||
};
|
||||
|
||||
void led_update_ports(led_t led_state) {
|
||||
rgblight_set_layer_state(0, led_state.caps_lock);
|
||||
rgblight_set_layer_state(1, led_state.scroll_lock);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
|
||||
RGBLIGHT_ENABLE = yes # Use RGB underglow light
|
||||
RGBLIGHT_DRIVER = custom
|
||||
WS2812_DRIVER_REQUIRED = yes
|
||||
|
||||
SRC += indicator.c led_driver.c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue