Skip to content

Commit 7582e47

Browse files
committed
fixup! Initial PoC for Dynamic lighting support
1 parent c6586bd commit 7582e47

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

builddefs/common_features.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ ifeq ($(MUSIC_ENABLE), yes)
9999
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
100100
endif
101101

102+
LAMPARRAY_ENABLE ?= no
103+
ifeq ($(LAMPARRAY_ENABLE), yes)
104+
SRC += $(QUANTUM_DIR)/lamparray/lamparray.c
105+
SRC += $(QUANTUM_DIR)/lamparray/lamparray_rgb_matrix.c
106+
endif
107+
102108
VALID_STENO_PROTOCOL_TYPES := geminipr txbolt all
103109
STENO_PROTOCOL ?= all
104110
ifeq ($(strip $(STENO_ENABLE)), yes)

quantum/lamparray/lamparray.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
#include <stdbool.h>
77
#include "util.h" // PACKED
88

9+
#if defined(__GNUC__)
10+
# define PACKED __attribute__((__packed__))
11+
#else
12+
# define PACKED
13+
#endif
14+
915
#define LAMPARRAY_REPORT_ID_ATTRIBUTES 0x01
1016
#define LAMPARRAY_REPORT_ID_ATTRIBUTES_REQUEST 0x02
1117
#define LAMPARRAY_REPORT_ID_ATTRIBUTES_RESPONSE 0x03

tmk_core/protocol/chibios/usb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) {
728728

729729
#ifdef LAMPARRAY_ENABLE
730730
case LAMPARRAY_INTERFACE:
731-
switch (setup->wValue.lbyte) {
731+
switch (usbp->setup[2]) { /*LSB(wValue) */
732732
case LAMPARRAY_REPORT_ID_ATTRIBUTES:
733733
static lamparray_attributes_report_t ret = {.report_id = LAMPARRAY_REPORT_ID_ATTRIBUTES};
734734
lamparray_get_attributes(&ret.attributes);
@@ -778,7 +778,7 @@ static bool usb_request_hook_cb(USBDriver *usbp) {
778778
break;
779779
#ifdef LAMPARRAY_ENABLE
780780
case LAMPARRAY_INTERFACE:
781-
switch (setup->wValue.lbyte) {
781+
switch (usbp->setup[2]) { /*LSB(wValue) */
782782
case LAMPARRAY_REPORT_ID_ATTRIBUTES_REQUEST:
783783
case LAMPARRAY_REPORT_ID_RANGE_UPDATE:
784784
case LAMPARRAY_REPORT_ID_MULTI_UPDATE:

0 commit comments

Comments
 (0)