Add vendor request to reset the MCU
There's two issues with this. 1. There's no way to force a USB reset. 2. This USB stack is cursed. I can't tell how much of the latter is my fault, though, so I'm keeping it in.
This commit is contained in:
@@ -15,12 +15,12 @@
|
|||||||
int anim_render(uint16_t *fb, int index, int frame);
|
int anim_render(uint16_t *fb, int index, int frame);
|
||||||
|
|
||||||
enum usb_control_resp bl_handler(enum usb_control_state state) {
|
enum usb_control_resp bl_handler(enum usb_control_state state) {
|
||||||
if (usb_control_request.bmRequestType != 0x60) return USB_CONTROL_RESP_PASS;
|
if ((usb_control_request.bmRequestType & 0x7f) != 0x43) return USB_CONTROL_RESP_PASS;
|
||||||
|
|
||||||
if (usb_control_request.bRequest != 0x69)
|
if (usb_control_request.bRequest != 0x69)
|
||||||
return USB_CONTROL_RESP_STALL;
|
return USB_CONTROL_RESP_STALL;
|
||||||
|
|
||||||
asm volatile("j 0x00");
|
if (state == USB_CONTROL_FINISHED) asm volatile("j 0x00");
|
||||||
return USB_CONTROL_RESP_ACK;
|
return USB_CONTROL_RESP_ACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user