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

Sn32 GMMK Full Rev2 master openrgb via hybrid #438

Open
wants to merge 1 commit into
base: sn32_master_openrgb
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,14 @@ ifeq ($(strip $(VIA_ENABLE)), yes)
OPT_DEFS += -DVIA_ENABLE
endif

ifeq ($(strip $(OPENRGB_ENABLE)), yes)
ifeq ($(strip $(VIA_ENABLE)), yes)
$(error OPENRGB_ENABLE and VIA_ENABLE cannot currently be enabled simultaneously)
endif
#ifeq ($(strip $(OPENRGB_ENABLE)), yes)
# ifeq ($(strip $(VIA_ENABLE)), yes)
# $(error OPENRGB_ENABLE and VIA_ENABLE cannot currently be enabled simultaneously)
# endif
RAW_ENABLE := yes
SRC += $(QUANTUM_DIR)/openrgb.c
OPT_DEFS += -DOPENRGB_ENABLE
endif
#endif

VALID_MAGIC_TYPES := yes
BOOTMAGIC_ENABLE ?= no
Expand Down
32 changes: 16 additions & 16 deletions keyboards/gmmk/full/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#define FORCE_NKRO /* default NRKO enabled */
#define DEBOUNCE 1 /* Debounce time in ms */
#define RGB_DISABLE_WHEN_USB_SUSPENDED true /* rgb off when power off / suspend */
// #define VIA_OPENRGB_HYBRID
#define VIA_OPENRGB_HYBRID
// #define USE_FRAMEBUFFER

/* default ripple effect */
Expand All @@ -67,24 +67,24 @@
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
//#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
//#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
//#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
//#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
//#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
//#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
//#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
//#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
//#define ENABLE_RGB_MATRIX_DUAL_BEACON
//#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
//#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
//#define ENABLE_RGB_MATRIX_RAINDROPS
//#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
//#define ENABLE_RGB_MATRIX_HUE_WAVE
//#define ENABLE_RGB_MATRIX_PIXEL_RAIN
//#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
//#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
Expand All @@ -107,4 +107,4 @@

#include "config_led.h"

// #define DEBUG_GMMK
// #define DEBUG_GMMK
2 changes: 1 addition & 1 deletion keyboards/gmmk/full/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
OPENRGB_ENABLE = no
OPENRGB_ENABLE = yes
VIA_ENABLE = yes
RGB_MATRIX_CUSTOM_USER = yes
2 changes: 1 addition & 1 deletion keyboards/gmmk/full/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RAW_ENABLE = yes

# ENCODER_ENABLE = yes
OPENRGB_ENABLE = yes

VIA_ENABLE = yes
USE_EXCEPTIONS_STACKSIZE = 0xE0
USE_PROCESS_STACKSIZE = 0x1E0

Expand Down
2 changes: 1 addition & 1 deletion quantum/openrgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static const uint8_t openrgb_rgb_matrix_effects_indexes[] = {
};
static uint8_t raw_hid_buffer[RAW_EPSIZE];

void raw_hid_receive(uint8_t *data, uint8_t length) {
void orgb_raw_hid_receive(uint8_t *data, uint8_t length) {
switch (*data) {
case OPENRGB_GET_PROTOCOL_VERSION:
openrgb_get_protocol_version();
Expand Down
22 changes: 22 additions & 0 deletions quantum/via.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,29 @@ __attribute__((weak)) void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
//
// raw_hid_send() is called at the end, with the same buffer, which was
// possibly modified with returned values.

// NEW begin
#ifdef VIA_OPENRGB_HYBRID
extern uint8_t is_orgb_mode;
#ifdef OPENRGB_ENABLE
extern void orgb_raw_hid_receive(uint8_t *data, uint8_t length);
#endif
#endif
// NEW end

void raw_hid_receive(uint8_t *data, uint8_t length) {

// NEW begin
#ifdef VIA_OPENRGB_HYBRID
if (is_orgb_mode) {
#ifdef OPENRGB_ENABLE
orgb_raw_hid_receive(data, length);
#endif
return;
}
#endif
// NEW end

uint8_t *command_id = &(data[0]);
uint8_t *command_data = &(data[1]);
switch (*command_id) {
Expand Down
Loading