simple rgblight control via hid
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define RAW_ENABLE
|
||||||
|
|
||||||
#ifndef CORTEX_ENABLE_WFI_IDLE
|
#ifndef CORTEX_ENABLE_WFI_IDLE
|
||||||
# define CORTEX_ENABLE_WFI_IDLE TRUE
|
# define CORTEX_ENABLE_WFI_IDLE TRUE
|
||||||
#endif // CORTEX_ENABLE_WFI_IDLE
|
#endif // CORTEX_ENABLE_WFI_IDLE
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "usb_descriptor.h"
|
#include "usb_descriptor.h"
|
||||||
#include "usb_driver.h"
|
#include "usb_driver.h"
|
||||||
#include "usb_types.h"
|
#include "usb_types.h"
|
||||||
|
#include "rgblight.h"
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
#ifdef NKRO_ENABLE
|
||||||
# include "keycode_config.h"
|
# include "keycode_config.h"
|
||||||
@@ -972,10 +973,8 @@ void raw_hid_send(uint8_t *data, uint8_t length) {
|
|||||||
chnWrite(&drivers.raw_driver.driver, data, length);
|
chnWrite(&drivers.raw_driver.driver, data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) {
|
void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||||
// Users should #include "raw_hid.h" in their own code
|
rgblight_setrgb(data[0], data[1], data[2]);
|
||||||
// and implement this function there. Leave this as weak linkage
|
|
||||||
// so users can opt to not handle data coming in.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void raw_hid_task(void) {
|
void raw_hid_task(void) {
|
||||||
|
|||||||
Reference in New Issue
Block a user