refactor: move default RGB/LED matrix #defines (#21938)
* refactor: move default RGB/LED matrix #defines Moving the fallback definitions of macros like LED_MATRIX_VAL_STEP and RGB_MATRIX_MAXIMUM_BRIGHTNESS to header files allows keyboards to leverage these defaults without requiring #ifdef guards (and often repeating said fallback definitions). * style: use if(n)def for consistency and remove redundant UINT8_MAX checks on maximum brightness Co-authored-by: Joel Challis <git@zvecr.com> * refactor: remove INDICATOR_MAX_BRIGHTNESS macro Co-authored-by: Joel Challis <git@zvecr.com> --------- Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
		
							parent
							
								
									f4677c866e
								
							
						
					
					
						commit
						346b06d391
					
				
					 18 changed files with 103 additions and 138 deletions
				
			
		| 
						 | 
				
			
			@ -58,35 +58,6 @@ const led_point_t k_led_matrix_center = LED_MATRIX_CENTER;
 | 
			
		|||
// -----End led effect includes macros-------
 | 
			
		||||
// ------------------------------------------
 | 
			
		||||
 | 
			
		||||
#ifndef LED_MATRIX_TIMEOUT
 | 
			
		||||
#    define LED_MATRIX_TIMEOUT 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_MAXIMUM_BRIGHTNESS) || LED_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX
 | 
			
		||||
#    undef LED_MATRIX_MAXIMUM_BRIGHTNESS
 | 
			
		||||
#    define LED_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_VAL_STEP)
 | 
			
		||||
#    define LED_MATRIX_VAL_STEP 8
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_SPD_STEP)
 | 
			
		||||
#    define LED_MATRIX_SPD_STEP 16
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_DEFAULT_MODE)
 | 
			
		||||
#    define LED_MATRIX_DEFAULT_MODE LED_MATRIX_SOLID
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_DEFAULT_VAL)
 | 
			
		||||
#    define LED_MATRIX_DEFAULT_VAL LED_MATRIX_MAXIMUM_BRIGHTNESS
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(LED_MATRIX_DEFAULT_SPD)
 | 
			
		||||
#    define LED_MATRIX_DEFAULT_SPD UINT8_MAX / 2
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// globals
 | 
			
		||||
led_eeconfig_t led_matrix_eeconfig; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr
 | 
			
		||||
uint32_t       g_led_timer;
 | 
			
		||||
| 
						 | 
				
			
			@ -632,7 +603,7 @@ void led_matrix_decrease_speed(void) {
 | 
			
		|||
void led_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) {
 | 
			
		||||
    led_matrix_eeconfig.flags = flags;
 | 
			
		||||
    eeconfig_flag_led_matrix(write_to_eeprom);
 | 
			
		||||
    dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.flags);
 | 
			
		||||
    dprintf("led matrix set flags [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.flags);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
led_flags_t led_matrix_get_flags(void) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue