BadUSB ID change (#1046)

* badusb: vid/pid/strings change
* demo script update
* removed vid/pid values

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-03-23 16:35:25 +03:00
committed by GitHub
parent 6470aa8ff9
commit d075e00ae1
19 changed files with 233 additions and 82 deletions

View File

@@ -18,6 +18,7 @@ typedef struct {
bool connected;
FuriHalUsbInterface* if_cur;
FuriHalUsbInterface* if_next;
void* if_ctx;
FuriHalUsbStateCallback callback;
void* cb_ctx;
} UsbSrv;
@@ -88,8 +89,9 @@ void furi_hal_usb_init(void) {
FURI_LOG_I(TAG, "Init OK");
}
void furi_hal_usb_set_config(FuriHalUsbInterface* new_if) {
void furi_hal_usb_set_config(FuriHalUsbInterface* new_if, void* ctx) {
usb.if_next = new_if;
usb.if_ctx = ctx;
if(usb.thread == NULL) {
// Service thread hasn't started yet, so just save interface mode
return;
@@ -246,7 +248,7 @@ static int32_t furi_hal_usb_thread(void* context) {
usb.if_cur->deinit(&udev);
}
if(usb.if_next != NULL) {
usb.if_next->init(&udev, usb.if_next);
usb.if_next->init(&udev, usb.if_next, usb.if_ctx);
usbd_reg_event(&udev, usbd_evt_reset, reset_evt);
FURI_LOG_I(TAG, "USB Mode change done");
usb.enabled = true;