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

[Keyboard] Add Blueberry #19915

Merged
merged 8 commits into from
Mar 16, 2023
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
17 changes: 17 additions & 0 deletions keyboards/toffee_studio/blueberry/blueberry.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright 2023 Toffee Studio
*
* 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 "blueberry.h"
37 changes: 37 additions & 0 deletions keyboards/toffee_studio/blueberry/blueberry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* Copyright 2023 Toffee Studio
*
* 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/>.
*/

#pragma once

#include "quantum.h"

#define LAYOUT( \
K00, K10, K05, K15, K04, K14, K03, K13, K02, K12, K01, K11, K06, K16, K07, \
K20, K30, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K27, \
K40, K50, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K47, \
K70, K60, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K76, K67, \
K80, K81, K82, K83, K84, K85, K86, K56, K77 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 },\
{ K10, K11, K12, K13, K14, K15, K16, KC_NO },\
{ K20, K21, K22, K23, K24, K25, K26, K27 },\
{ K30, K31, K32, K33, K34, K35, K36, KC_NO },\
{ K40, K41, K42, K43, K44, K45, K46, K47 },\
{ K50, K51, K52, K53, K54, K55, K56, KC_NO },\
{ K60, K61, K62, K63, K64, K65, K66, K67 },\
{ K70, K71, K72, K73, K74, K75, K76, K77 },\
{ K80, K81, K82, K83, K84, K85, K86, KC_NO } \
}
46 changes: 46 additions & 0 deletions keyboards/toffee_studio/blueberry/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* Copyright 2023 Toffee Studio
*
* 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/>.
*/

#pragma once

#define RGB_DI_PIN D0
#ifdef RGB_DI_PIN
# define RGBLED_NUM 22

/* RGB LED logical order map */
/* Top->Bottom, Right->Left */
#define RGBLIGHT_LED_MAP { \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be blunt, you might be better off using rgb matrix, with how this is wired up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its working as is 🤔
tbh; i wasnt the one who did the fw, and dont have much experience with it either.

what would be the potential benefits from changing it?
its working as is, so i dont see a reason to change it, id also need to bother the person who did the fw in the first and ask them to spend some more time on it, even tho its already working.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RGB Light is meant for linear effects, while rgb matrix is meant for 2D animations.

While RGB Light works, as somebody that has boards that support layouts like this, rgb matrix produces a much better experience visually, because of how the animations are designed.

And the config needed isn't very difficult, either. And if needed, I can see about helping with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you dont mind; my (not toffeestudio's) discord nick is Suzu#9521
iirc tho, we had a bit of trouble with file size already due to using a 32u4; so if matrix is more complex/bigger in filesize it likely wouldnt be possible to add/change it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RGB Matrix is more geared towards per-key LEDs. If these are underglow (on the back of the PCB), RGBlight is fine here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the compiled size, that depends heavily on which animations are enabled. RGB Matrix has a lot more animations, but a lot of them share code. Also, it's a bit more performant.

I think this is the led config you'd need for rgb matrix:

led_config_t g_led_config = { {
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
    { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
}, {
    {45,64},{60,64},{75,64},{90,64},{105,64},{120,64},{135,64},{150,64},{165,64},
    {165, 42}, {165, 21}, 
    {165,0},{150,0},{135,0},{120,0},{105,0},{90,0},{75,0},{60,0},{45,0},
    {45, 21}, {45, 42}
}, {
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
} };

You'd want to drop this in blueberry.c, add the rgb matrix config, and enable it.

19, 18, 17, 16, 15, 14, 13, 12, 11, \
20, 10, \
21, 9, \
0, 1, 2, 3, 4, 5, 6, 7, 8 }

/* The maximum brightness level up to 255 */
#define RGBLIGHT_LIMIT_VAL 192 //limited to 75% brightness
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_ALTERNATING
#endif

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
Loading