add buggy extra config UI for bad usb (for implementing BLE and UART)

This commit is contained in:
yocvito
2023-01-01 02:17:40 +01:00
parent f808608135
commit 202596ad38
13 changed files with 302 additions and 36 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ FuriHalBtProfileConfig profile_config[FuriHalBtProfileNumber] = {
.supervisor_timeout = 0,
},
},
},
}
};
FuriHalBtProfileConfig* current_profile = NULL;
+18 -3
View File
@@ -139,9 +139,24 @@ void furi_hal_bt_hid_start() {
hid_svc_start();
}
// Configure HID Keyboard
kb_report = malloc(sizeof(FuriHalBtHidKbReport));
mouse_report = malloc(sizeof(FuriHalBtHidMouseReport));
consumer_report = malloc(sizeof(FuriHalBtHidConsumerReport));
//
// this will also be called by Bad-usb now, so we need to prevent memory leak
// I dont know for now, how apps and mains interacts together, so lets add some
// protection in case a crash in one doesn't affect the other
if(kb_report)
memset(kb_report, 0, sizeof(FuriHalBtHidKbReport));
else
kb_report = malloc(sizeof(FuriHalBtHidKbReport));
if(mouse_report)
memset(mouse_report, 0, sizeof(FuriHalBtHidMouseReport));
else
mouse_report = malloc(sizeof(FuriHalBtHidMouseReport));
if(consumer_report)
memset(consumer_report, 0, sizeof(FuriHalBtHidConsumerReport));
else
consumer_report = malloc(sizeof(FuriHalBtHidConsumerReport));
// Configure Report Map characteristic
hid_svc_update_report_map(
furi_hal_bt_hid_report_map_data, sizeof(furi_hal_bt_hid_report_map_data));