Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocate work_louder VIA logic #24011

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 26 additions & 56 deletions keyboards/work_louder/rgb_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,32 @@

#include "keycodes.h"

#ifndef VIA_ENABLE
# ifndef RGB_MATRIX_TOGGLE
# define RGB_MATRIX_TOGGLE KC_F15
# endif
# ifndef RGB_MATRIX_MODE_INC
# define RGB_MATRIX_MODE_INC KC_F16
# endif
# ifndef RGB_MATRIX_MODE_DEC
# define RGB_MATRIX_MODE_DEC KC_F17
# endif
# ifndef RGB_MATRIX_HUE_INC
# define RGB_MATRIX_HUE_INC KC_F18
# endif
# ifndef RGB_MATRIX_HUE_DEC
# define RGB_MATRIX_HUE_DEC KC_F19
# endif
# ifndef RGB_MATRIX_SAT_INC
# define RGB_MATRIX_SAT_INC KC_F20
# endif
# ifndef RGB_MATRIX_SAT_DEC
# define RGB_MATRIX_SAT_DEC KC_F21
# endif
# ifndef RGB_MATRIX_VAL_INC
# define RGB_MATRIX_VAL_INC KC_F22
# endif
# ifndef RGB_MATRIX_VAL_DEC
# define RGB_MATRIX_VAL_DEC KC_F23
# endif
#else
# ifndef RGB_MATRIX_TOGGLE
# define RGB_MATRIX_TOGGLE QK_KB_0
# endif
# ifndef RGB_MATRIX_MODE_INC
# define RGB_MATRIX_MODE_INC QK_KB_1
# endif
# ifndef RGB_MATRIX_MODE_DEC
# define RGB_MATRIX_MODE_DEC QK_KB_2
# endif
# ifndef RGB_MATRIX_HUE_INC
# define RGB_MATRIX_HUE_INC QK_KB_3
# endif
# ifndef RGB_MATRIX_HUE_DEC
# define RGB_MATRIX_HUE_DEC QK_KB_4
# endif
# ifndef RGB_MATRIX_SAT_INC
# define RGB_MATRIX_SAT_INC QK_KB_5
# endif
# ifndef RGB_MATRIX_SAT_DEC
# define RGB_MATRIX_SAT_DEC QK_KB_6
# endif
# ifndef RGB_MATRIX_VAL_INC
# define RGB_MATRIX_VAL_INC QK_KB_7
# endif
# ifndef RGB_MATRIX_VAL_DEC
# define RGB_MATRIX_VAL_DEC QK_KB_8
# endif
#ifndef RGB_MATRIX_TOGGLE
# define RGB_MATRIX_TOGGLE QK_KB_0
#endif
#ifndef RGB_MATRIX_MODE_INC
# define RGB_MATRIX_MODE_INC QK_KB_1
#endif
#ifndef RGB_MATRIX_MODE_DEC
# define RGB_MATRIX_MODE_DEC QK_KB_2
#endif
#ifndef RGB_MATRIX_HUE_INC
# define RGB_MATRIX_HUE_INC QK_KB_3
#endif
#ifndef RGB_MATRIX_HUE_DEC
# define RGB_MATRIX_HUE_DEC QK_KB_4
#endif
#ifndef RGB_MATRIX_SAT_INC
# define RGB_MATRIX_SAT_INC QK_KB_5
#endif
#ifndef RGB_MATRIX_SAT_DEC
# define RGB_MATRIX_SAT_DEC QK_KB_6
#endif
#ifndef RGB_MATRIX_VAL_INC
# define RGB_MATRIX_VAL_INC QK_KB_7
#endif
#ifndef RGB_MATRIX_VAL_DEC
# define RGB_MATRIX_VAL_DEC QK_KB_8
#endif

#define R_M_TOG RGB_MATRIX_TOGGLE
Expand Down
2 changes: 0 additions & 2 deletions keyboards/work_louder/work_board/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions keyboards/work_louder/work_board/keymaps/via/config.h
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions keyboards/work_louder/work_board/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 0 additions & 15 deletions keyboards/work_louder/work_board/work_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading