mirror of
https://github.com/ndeadly/MissionControl
synced 2024-11-22 20:33:07 +00:00
btdrv-mitm: create fake buffer in shared memory for all firmwares
This commit is contained in:
parent
e310d89491
commit
1d55a4539c
1 changed files with 3 additions and 12 deletions
|
@ -96,9 +96,6 @@ namespace ams::bluetooth::hid::report {
|
|||
void Finalize(void) {
|
||||
os::DestroyThread(&g_eventHandlerThread);
|
||||
|
||||
//if (hos::GetVersion() < hos::Version_7_0_0)
|
||||
//delete g_fakeBuffer;
|
||||
|
||||
os::DestroySystemEvent(&g_btHidReportSystemEventUser);
|
||||
os::DestroySystemEvent(&g_btHidReportSystemEventFwd);
|
||||
|
||||
|
@ -116,15 +113,9 @@ namespace ams::bluetooth::hid::report {
|
|||
Result InitializeReportBuffer(void) {
|
||||
BTDRV_LOG_FMT("btdrv-mitm: InitializeReportBuffer");
|
||||
|
||||
// Todo: maybe just create shared memory for all fw?
|
||||
if (hos::GetVersion() < hos::Version_7_0_0) {
|
||||
g_fakeBuffer = new CircularBuffer();
|
||||
}
|
||||
else {
|
||||
R_TRY(shmemCreate(&g_fakeBtShmem, BLUETOOTH_SHAREDMEM_SIZE, Perm_Rw, Perm_Rw));
|
||||
R_TRY(shmemMap(&g_fakeBtShmem));
|
||||
g_fakeBuffer = reinterpret_cast<bluetooth::CircularBuffer *>(shmemGetAddr(&g_fakeBtShmem));
|
||||
}
|
||||
R_TRY(shmemCreate(&g_fakeBtShmem, BLUETOOTH_SHAREDMEM_SIZE, Perm_Rw, Perm_Rw));
|
||||
R_TRY(shmemMap(&g_fakeBtShmem));
|
||||
g_fakeBuffer = reinterpret_cast<bluetooth::CircularBuffer *>(shmemGetAddr(&g_fakeBtShmem));
|
||||
|
||||
g_fakeBuffer->Initialize("HID Report");
|
||||
g_fakeBuffer->type = bluetooth::CircularBufferType_HidReport;
|
||||
|
|
Loading…
Reference in a new issue