Relocate work_louder VIA logic (#24011)
This commit is contained in:
		
							parent
							
								
									62f81cfcc3
								
							
						
					
					
						commit
						07253bfe4a
					
				
					 5 changed files with 48 additions and 73 deletions
				
			
		| 
						 | 
				
			
			@ -23,5 +23,3 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		|||
 | 
			
		||||
#define RGB_MATRIX_LED_COUNT              49
 | 
			
		||||
#define RGB_MATRIX_DISABLE_KEYCODES
 | 
			
		||||
 | 
			
		||||
#define VIA_EEPROM_LAYOUT_OPTIONS_DEFAULT 0x1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,10 @@
 | 
			
		|||
// Copyright 2023 QMK
 | 
			
		||||
// SPDX-License-Identifier: GPL-2.0-or-later
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#define NO_ACTION_ONESHOT
 | 
			
		||||
 | 
			
		||||
#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
 | 
			
		||||
#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL
 | 
			
		||||
 | 
			
		||||
#define VIA_EEPROM_LAYOUT_OPTIONS_DEFAULT 0x1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -214,3 +214,21 @@ void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
 | 
			
		|||
    }
 | 
			
		||||
    *command_id = id_unhandled;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool via_layout_2u = false;
 | 
			
		||||
 | 
			
		||||
void via_set_layout_options_kb(uint32_t value) {
 | 
			
		||||
    via_layout_2u = (bool)value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef RGB_MATRIX_ENABLE
 | 
			
		||||
bool rgb_matrix_indicators_user(void) {
 | 
			
		||||
    if (via_layout_2u) {
 | 
			
		||||
        rgb_matrix_set_color(5, 0, 0, 0);
 | 
			
		||||
        rgb_matrix_set_color(7, 0, 0, 0);
 | 
			
		||||
    } else {
 | 
			
		||||
        rgb_matrix_set_color(6, 0, 0, 0);
 | 
			
		||||
    }
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,27 +67,12 @@ bool oled_task_kb(void) {
 | 
			
		|||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef RGB_MATRIX_ENABLE
 | 
			
		||||
#    ifdef VIA_ENABLE
 | 
			
		||||
bool via_layout_2u = false;
 | 
			
		||||
 | 
			
		||||
void via_set_layout_options_kb(uint32_t value) { via_layout_2u = (bool)value; }
 | 
			
		||||
#    endif  // VIA_ENABLE
 | 
			
		||||
 | 
			
		||||
bool rgb_matrix_indicators_kb(void) {
 | 
			
		||||
    if (!rgb_matrix_indicators_user()) {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
#    ifdef VIA_ENABLE
 | 
			
		||||
    if (via_layout_2u) {
 | 
			
		||||
        rgb_matrix_set_color(5, 0, 0, 0);
 | 
			
		||||
        rgb_matrix_set_color(7, 0, 0, 0);
 | 
			
		||||
    } else {
 | 
			
		||||
        rgb_matrix_set_color(6, 0, 0, 0);
 | 
			
		||||
    }
 | 
			
		||||
#    else
 | 
			
		||||
    rgb_matrix_set_color(5, 0, 0, 0);
 | 
			
		||||
    rgb_matrix_set_color(7, 0, 0, 0);
 | 
			
		||||
#    endif
 | 
			
		||||
    return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue