Skip to content

Commit

Permalink
Merge pull request qmk#15 from sadekbaroudi/fp/config_rgb_matrix_support
Browse files Browse the repository at this point in the history
added support for rgb matrix as well for everything that's currently …
  • Loading branch information
sadekbaroudi authored Oct 6, 2022
2 parents 78f5880 + 13643c3 commit 7ac65df
Show file tree
Hide file tree
Showing 30 changed files with 572 additions and 201 deletions.
6 changes: 5 additions & 1 deletion keyboards/fingerpunch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,18 @@ void pointing_device_init_user(void) {
## RGB Lighting
Note that unless otherwise specified, features for rgb are supported on both rgblight ( https://github.com/qmk/qmk_firmware/blob/master/docs/feature_rgblight.md ) and rgb matrix ( https://github.com/qmk/qmk_firmware/blob/master/docs/feature_rgb_matrix.md ).
Some config parameters will depend on which you're using, like `FP_LAYER_LIGHTING_MODE`.
### Layer lighting
If using this feature (`FP_LAYER_LIGHTING_ENABLE`), please note that the `FP_LAYER_LIGHTING_AUTO_MOUSE_ENABLE` will be automatically disabled. Given that this feature will handle the auto mouse layer as well, you don't need to activate the layer lighting twice. Just set the mouse layer lighting to the color you prefer using the `FP_LAYER_LIGHTING_HUE_X` below.
| Setting | Description | Default |
| --------------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `FP_LAYER_LIGHTING_ENABLE` | (Optional) Define this to enable layer lighting | `undefined` |
| `FP_LAYER_LIGHTING_MODE` | (Required) Set the layer lighting default mode | `RGBLIGHT_MODE_STATIC_LIGHT` |
| `FP_LAYER_LIGHTING_MODE` | (Required) Set the layer lighting default mode | `RGBLIGHT_MODE_STATIC_LIGHT` or `RGB_MATRIX_SOLID_COLOR` |
| `FP_LAYER_LIGHTING_HUE_0` | (Required) Set the layer lighting hue for layer 0 | `HSV_BLUE` |
| `FP_LAYER_LIGHTING_HUE_1` | (Required) Set the layer lighting hue for layer 1 | `HSV_WHITE` |
| `FP_LAYER_LIGHTING_HUE_2` | (Required) Set the layer lighting hue for layer 2 | `HSV_GREEN` |
Expand Down
1 change: 1 addition & 0 deletions keyboards/fingerpunch/arachnophobe/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
1 change: 1 addition & 0 deletions keyboards/fingerpunch/barobord/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
1 change: 1 addition & 0 deletions keyboards/fingerpunch/barobord_byomcu/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
1 change: 1 addition & 0 deletions keyboards/fingerpunch/bgkeeb/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
1 change: 1 addition & 0 deletions keyboards/fingerpunch/bigbarobord/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
1 change: 1 addition & 0 deletions keyboards/fingerpunch/ffkb/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
45 changes: 0 additions & 45 deletions keyboards/fingerpunch/ffkb_byomcu/ffkb_byomcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ffkb_byomcu.h"
#ifdef RGB_MATRIX_ENABLE

// 6 column config
led_config_t g_led_config = { {
{2, 3, 8, 9, 14, 15, 26, 27},
{1, 4, 7, 10, 13, 16, 25, 28},
{0, 5, 6, 11, 12, 17, 24, 29},
{NO_LED, NO_LED, 31, 35, 33, 37, 36, 39},
{NO_LED, NO_LED, 30, 32, 34, 38, 41, 40},
{NO_LED, NO_LED, 23, 18, 19, 20, 21, 22}
}, {
{0,32},{3,19},{7,5},{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4},{215,5},{219,19},{223,32}
}, {
1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 1, 1
} };

// 5 column config
/*
led_config_t g_led_config = { {
{NO_LED, 0, 5, 6, 11, 12, 23, 24},
{NO_LED, 1, 4, 7, 10, 13, 22, 25},
{NO_LED, 2, 3, 8, 9, 14, 21, 26},
{NO_LED, NO_LED, 28, 32, 30, 34, 33, NO_LED},
{NO_LED, NO_LED, 27, 29, 31, 35, NO_LED, NO_LED},
{NO_LED, NO_LED, 20, 15, 16, 17, 18, 19}
}, {
{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4}
}, {
4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4
} };
*/

#endif
1 change: 1 addition & 0 deletions keyboards/fingerpunch/ffkb_byomcu/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ SRC += keyboards/fingerpunch/fp.c \
keyboards/fingerpunch/fp_haptic.c \
keyboards/fingerpunch/fp_keyhandler.c \
keyboards/fingerpunch/fp_pointing.c \
keyboards/fingerpunch/fp_rgb_common.c \
keyboards/fingerpunch/fp_rgblight.c \
keyboards/fingerpunch/fp_rgb_matrix.c
60 changes: 60 additions & 0 deletions keyboards/fingerpunch/ffkb_byomcu/v1/v1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* Copyright 2021 Sadek Baroudi <sadekbaroudi@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "v1.h"

#ifdef RGB_MATRIX_ENABLE
// 6 column config
led_config_t g_led_config = { {
{2, 3, 8, 9, 14, 15, 26, 27},
{1, 4, 7, 10, 13, 16, 25, 28},
{0, 5, 6, 11, 12, 17, 24, 29},
{NO_LED, NO_LED, 31, 35, 33, 37, 36, 39},
{NO_LED, NO_LED, 30, 32, 34, 38, 41, 40},
{NO_LED, NO_LED, 23, 18, 19, 20, 21, 22}
}, {
{0,32},{3,19},{7,5},{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4},{215,5},{219,19},{223,32}
}, {
1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 1, 1
} };

// 5 column config
/*
led_config_t g_led_config = { {
{NO_LED, 0, 5, 6, 11, 12, 23, 24},
{NO_LED, 1, 4, 7, 10, 13, 22, 25},
{NO_LED, 2, 3, 8, 9, 14, 21, 26},
{NO_LED, NO_LED, 28, 32, 30, 34, 33, NO_LED},
{NO_LED, NO_LED, 27, 29, 31, 35, NO_LED, NO_LED},
{NO_LED, NO_LED, 20, 15, 16, 17, 18, 19}
}, {
{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4}
}, {
4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4
} };
*/
#endif
60 changes: 60 additions & 0 deletions keyboards/fingerpunch/ffkb_byomcu/v2/v2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* Copyright 2021 Sadek Baroudi <sadekbaroudi@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "v2.h"

#ifdef RGB_MATRIX_ENABLE
// 6 column config
led_config_t g_led_config = { {
{2, 3, 8, 9, 14, 15, 26, 27},
{1, 4, 7, 10, 13, 16, 25, 28},
{0, 5, 6, 11, 12, 17, 24, 29},
{NO_LED, NO_LED, 31, 35, 33, 37, 36, 39},
{NO_LED, NO_LED, 30, 32, 34, 38, 41, 40},
{NO_LED, NO_LED, 23, 18, 19, 20, 21, 22}
}, {
{0,32},{3,19},{7,5},{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4},{215,5},{219,19},{223,32}
}, {
1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 1, 1
} };

// 5 column config
/*
led_config_t g_led_config = { {
{NO_LED, 0, 5, 6, 11, 12, 23, 24},
{NO_LED, 1, 4, 7, 10, 13, 22, 25},
{NO_LED, 2, 3, 8, 9, 14, 21, 26},
{NO_LED, NO_LED, 28, 32, 30, 34, 33, NO_LED},
{NO_LED, NO_LED, 27, 29, 31, 35, NO_LED, NO_LED},
{NO_LED, NO_LED, 20, 15, 16, 17, 18, 19}
}, {
{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4}
}, {
4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4
} };
*/
#endif
38 changes: 38 additions & 0 deletions keyboards/fingerpunch/ffkb_byomcu/v3/v3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright 2021 Sadek Baroudi <sadekbaroudi@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "v3.h"

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
{ 3, 9, 15, 10, 16, 27, 28, 4 },
{ 2, 8, 14, 11, 17, 26, 29, 5 },
{ 1, 7, 13, 12, 18, 25, 30, 6 },
{ NO_LED, 32, 34, 36, 38, 37, 40, NO_LED },
{ NO_LED, 31, 35, 33, 39, 42, 41, NO_LED },
{ NO_LED, 24, 20, 19, 21, 22, 23, NO_LED }
}, {
{0,32},{3,19},{7,5},{25,4},{21,18},{17,31},{35,26},{39,12},{43,0},{60,0},{56,12},{52,26},
{66,33},{70,20},{74,6},{89,12},{85,25},{81,38},{61,50},{77,55},{93,63},{129,63},{145,55},{161,50},
{141,38},{137,25},{133,12},{148,6},{152,20},{156,33},{170,26},{166,12},{162,0},{179,0},{183,12},{187,26},
{205,31},{201,18},{197,4},{215,5},{219,19},{223,32}
}, {
1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 1, 1
} };

#endif
3 changes: 3 additions & 0 deletions keyboards/fingerpunch/fp.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ void keyboard_post_init_kb(void) {
}

layer_state_t layer_state_set_kb(layer_state_t state) {
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
state = fp_layer_state_set_rgb(state);
#endif
#ifdef RGBLIGHT_ENABLE
state = fp_layer_state_set_rgblight(state);
#endif // RGBLIGHT_ENABLE
Expand Down
3 changes: 3 additions & 0 deletions keyboards/fingerpunch/fp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ void press_super_tab(bool shift);
// #include "keyboards/fingerpunch/fp.h"

#include "keyboards/fingerpunch/fp_keyhandler.h"
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
# include "keyboards/fingerpunch/fp_rgb_common.h"
#endif
#ifdef RGBLIGHT_ENABLE
# include "keyboards/fingerpunch/fp_rgblight.h"
#endif
Expand Down
Loading

0 comments on commit 7ac65df

Please sign in to comment.