Fixed starting crash

This commit is contained in:
homayk228
2025-08-31 14:33:04 +07:00
parent 02ca5835eb
commit d858c528ba
5 changed files with 43 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/build

34
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,34 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "cmake",
"request": "launch",
"name": "CMake: Configure project",
"cmakeDebugType": "configure",
"clean": true,
"configureAll": false
},
{
"name": "C/C++ Debug (gdb Launch)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/bloody",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.10)
project(bloody)
find_package(PkgConfig REQUIRED)

View File

@@ -137,7 +137,7 @@ int Mouse::readFromMouse(uint8_t *request, size_t requestSize, uint8_t *response
cout<<"Unnable to receive data"<<endl;
return -2;
}
return 0;
}
@@ -204,6 +204,9 @@ void Mouse::listDevices() {
case BLOODY_J95S_PID:
name = "Bloody J95S";
break;
case BLOODY_RT7_PID:
name = "Bloody RT7";
break;
default:
name = "Unknown";
}

View File

@@ -23,8 +23,9 @@ static const int BLOODY_AL9_PID = 0xf633;
static const int BLOODY_R70_PID = 0xf643;
static const int BLOODY_A7_PID = 0x7e36;
static const int BLOODY_A9_PID = 0x1003;
static const int BLOODY_RT7_PID = 0x144d;
static const int COMPATIBLE_PIDS[] = {BLOODY_J95S_PID, BLOODY_RT5_PID, BLOODY_V8M_PID, BLOODY_R8_PID, BLOODY_V5_PID, BLOODY_V7_PID, BLOODY_V8_PID, BLOODY_R7_PID, BLOODY_R8_1_PID, BLOODY_R3_PID, BLOODY_AL9_PID, BLOODY_R70_PID, BLOODY_A7_PID, BLOODY_A9_PID};
static const int COMPATIBLE_PIDS[] = {BLOODY_J95S_PID, BLOODY_RT5_PID, BLOODY_V8M_PID, BLOODY_R8_PID, BLOODY_V5_PID, BLOODY_V7_PID, BLOODY_V8_PID, BLOODY_R7_PID, BLOODY_R8_1_PID, BLOODY_R3_PID, BLOODY_AL9_PID, BLOODY_R70_PID, BLOODY_A7_PID, BLOODY_A9_PID, BLOODY_RT7_PID};
static const size_t COMPATIBLE_PIDS_SIZE = sizeof(COMPATIBLE_PIDS)/sizeof(COMPATIBLE_PIDS[0]);
static const int A4TECH_MAGIC = 0x07;