summaryrefslogtreecommitdiff
path: root/keyboards/work_louder
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-02-06 14:01:04 -0800
committerGitHub <noreply@github.com>2022-02-06 22:01:04 +0000
commit9124f5dc2d2f17eb327924d38add7f194dd4d54a (patch)
treea53ab1c9d62be1fff6edf11b18a6acd3b56991e3 /keyboards/work_louder
parent3b60e71f07ac3a1ba8d46c3ecb9de8198ad9b945 (diff)
downloadqmk_firmware-9124f5dc2d2f17eb327924d38add7f194dd4d54a.tar.gz
qmk_firmware-9124f5dc2d2f17eb327924d38add7f194dd4d54a.zip
Add layout change callbacks to VIA (#16087)
* Add layout change callbacks to VIA * Update worklouder example
Diffstat (limited to 'keyboards/work_louder')
-rw-r--r--keyboards/work_louder/work_board/work_board.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c
index 7a8edc1a9e..d25ea0cdba 100644
--- a/keyboards/work_louder/work_board/work_board.c
+++ b/keyboards/work_louder/work_board/work_board.c
@@ -100,15 +100,15 @@ led_config_t g_led_config = { {
} };
// clang-format on
+# 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
+
__attribute__((weak)) void rgb_matrix_indicators_user(void) {
# ifdef VIA_ENABLE
- static bool layout_2u = false;
- static uint16_t timer = 0;
- if (timer_elapsed(timer) > 500) {
- timer = timer_read();
- layout_2u = (bool)via_get_layout_options();
- }
- if (layout_2u) {
+ if (via_layout_2u) {
rgb_matrix_set_color(5, 0, 0, 0);
rgb_matrix_set_color(7, 0, 0, 0);
} else {