diff options
author | Drashna Jaelre <drashna@live.com> | 2021-09-02 10:49:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 10:49:44 -0700 |
commit | 956cf8d7bfbca187ad9d1e0aabbe6c25348d5e07 (patch) | |
tree | db604cf57706a84bfeac69db13e16cdf2ade3dfb /keyboards/work_louder/work_board/work_board.c | |
parent | d36a7c512d14e3bc6534f311e8f1a8a69878acb3 (diff) |
[Keyboard] Work Louder board fixup (#14247)
* [Keyboard] Add some last minute tweaks to Work board
* Additional fixes
* Fix rgb pin
* Fix ws2812 hackery
* additional led tweaks
* Add indicator LEDs
* fix bootmagic settings
* Fix up RGB stuff
* Limit power draw for entire board
* fixup lights and such
* change LED order on loop
* Fix indicators if via is not enabled
* Enable Sleep for rgb matrix
* Even more LED tweaks
* Final tweaks?
* Tweak keycodes
Diffstat (limited to 'keyboards/work_louder/work_board/work_board.c')
-rw-r--r-- | keyboards/work_louder/work_board/work_board.c | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/keyboards/work_louder/work_board/work_board.c b/keyboards/work_louder/work_board/work_board.c index e17f7417cc..a2722a055a 100644 --- a/keyboards/work_louder/work_board/work_board.c +++ b/keyboards/work_louder/work_board/work_board.c @@ -18,7 +18,9 @@ #if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { return false; } + if (!encoder_update_user(index, clockwise)) { + return false; + } if (clockwise) { tap_code(KC_VOLD); } else { @@ -71,23 +73,56 @@ __attribute__((weak)) void oled_task_user(void) { } #endif - #ifdef RGB_MATRIX_ENABLE +// clang-format off led_config_t g_led_config = { { - { 49, 48, 47, 46, 45, 43, 42, 41, 40, 39, 38, 37}, - { 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }, - { 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13 }, - { 0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12 }, + { 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }, + { 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25 }, + { 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }, + { 12, 11, 10, 9, 8, 7, 5, 4, 3, 2, 1, 0} }, { - { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 }, + { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 }, { 112, 63 }, { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 }, { 0, 42 }, { 20, 42 }, { 40, 42 }, { 61, 42 }, { 81, 42 }, { 101, 42 }, { 122, 42 }, { 142, 42 }, { 162, 42 }, { 183, 42 }, { 203, 42 }, { 223, 42 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 }, { 20, 21 }, { 0, 21 }, - { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 132, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 }, + { 0, 0 }, { 20, 0 }, { 40, 0 }, { 61, 0 }, { 81, 0 }, { 101, 0 }, { 122, 0 }, { 142, 0 }, { 162, 0 }, { 183, 0 }, { 203, 0 }, { 223, 0 } }, { + 1, 1, 1, 1, 1, 4,4,4, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 1, 1, 1, 4,4,4, 1, 1, 1, 1, 1 + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1 } }; +// clang-format on + +__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) { + 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 +} + +void keyboard_pre_init_kb(void) { + setPinOutput(B2); + setPinOutput(B3); + setPinOutput(B7); + + writePinLow(B2); + writePinLow(B3); + writePinLow(B7); + + keyboard_pre_init_user(); +} #endif |