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

添加OpenRGB支持,并提供源码;修复SignalRGB插件中的错误 #151

Open
wants to merge 6 commits into
base: main
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
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,12 @@ static int8_t CUSTOM_HID_DeInit_FS(void)
static int8_t CUSTOM_HID_OutEvent_FS(uint8_t event_idx, uint8_t state)
{
/* USER CODE BEGIN 6 */

uint8_t USB_Received_Count = USBD_GetRxCount( &hUsbDeviceFS,CUSTOM_HID_EPOUT_ADDR );
USBD_CUSTOM_HID_HandleTypeDef *hhid;
hhid = (USBD_CUSTOM_HID_HandleTypeDef*)hUsbDeviceFS.pClassData;
if(USB_Received_Count>0){
HID_RxCpltCallback(hhid->Report_buf);
}

return (USBD_OK);
/* USER CODE END 6 */
Expand Down
2 changes: 1 addition & 1 deletion 2.Firmware/HelloWord-Keyboard-fw/UserApp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef* hspi)
extern "C"
void HID_RxCpltCallback(uint8_t* _data)
{
if(_data[1] == 0xbd) isSoftWareControlColor= false;
isSoftWareControlColor= false;
if(_data[1] == 0xac) {
isSoftWareControlColor = true;
uint8_t pageIndex = _data[2];
Expand Down
38 changes: 14 additions & 24 deletions 3.Software/HelloWord_plugin.js

Large diffs are not rendered by default.

Binary file added 3.Software/OpenRGB_Realse_0.81.zip
Binary file not shown.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@
## 1. 项目说明

### 1.0 更新说明:
**23.2.27更新:**

* 修复了上位机突然关闭,键盘RGB不会切换到本地灯效的逻辑判定问题
* 为键盘主体添加OpenRGB支持,需使用[项目中提供的OpenRGB](https://github.com/RedWolf-369/OpenRGB)并在软件里面安装对应插件,仅支持64位Windows系统.

**23.2.20更新**
* 修改`CUSTOM_HID_EPOUT_ADDR = 2`,HID_RxCpltCallback位置变更到CUSTOM_HID_OutEvent_FS中(原来的位置可能导致while循环内无法发送report)。

> * main里面增加了RGB控制相关代码,可以通过HID协议发送数据包来控制键盘RGB效果
> * 已对接SignalRGB,Software中添加SignalRGB插件
> * report包大小33字节,前三个字节依次为reportid(本项目为2)、控制命令0xAC(上位机控制),0xBD(关闭上位机控制),report包次序(一个包最多传10个RGB值,需要多个包拼接,从0计算);后30字节为RGB值。
> * report包大小33字节,前三个字节依次为reportid(本项目为2)、控制命令0xAC(上位机控制),其他字符(关闭上位机控制),report包次序(一个包最多传10个RGB值,需要多个包拼接,从0计算);后30字节为RGB值。


**22.8.31更新:**
Expand Down