Add init function to RGBLight driver struct (#23076)
This commit is contained in:
		
							parent
							
								
									23b7a02ebe
								
							
						
					
					
						commit
						f7cf40fa77
					
				
					 42 changed files with 306 additions and 93 deletions
				
			
		| 
						 | 
				
			
			@ -21,5 +21,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
void keyboard_post_init_user(void) {
 | 
			
		||||
  rgblite_init();
 | 
			
		||||
  rgblite_increase_hue();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,6 +6,10 @@
 | 
			
		|||
#include "ws2812.h"
 | 
			
		||||
#include "color.h"
 | 
			
		||||
 | 
			
		||||
static inline void rgblite_init(void) {
 | 
			
		||||
    ws2812_init();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void rgblite_setrgb(RGB rgb) {
 | 
			
		||||
    rgb_led_t leds[RGBLIGHT_LED_COUNT] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
 | 
			
		||||
    ws2812_setleds(leds, RGBLIGHT_LED_COUNT);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue