mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 09:38:35 -07:00
JS unlock BadUSB automatically
This commit is contained in:
@@ -120,12 +120,8 @@ static void js_badusb_setup(struct mjs* mjs) {
|
|||||||
|
|
||||||
badusb->usb_if_prev = furi_hal_usb_get_config();
|
badusb->usb_if_prev = furi_hal_usb_get_config();
|
||||||
|
|
||||||
if(!furi_hal_usb_set_config(&usb_hid, badusb->hid_cfg)) {
|
furi_hal_usb_unlock();
|
||||||
mjs_prepend_errorf(mjs, MJS_INTERNAL_ERROR, "USB is locked, close companion app first");
|
furi_hal_usb_set_config(&usb_hid, badusb->hid_cfg);
|
||||||
badusb->usb_if_prev = NULL;
|
|
||||||
mjs_return(mjs, MJS_UNDEFINED);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mjs_return(mjs, MJS_UNDEFINED);
|
mjs_return(mjs, MJS_UNDEFINED);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user