Skip to content

Commit 6172664

Browse files
fix usb kinda
1 parent 7018586 commit 6172664

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

core/usb/msd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "device.h"
22

33
#include "../os/os.h"
4+
#include "../emu.h"
45

56
#include <errno.h>
67
#include <stdbool.h>
@@ -167,6 +168,8 @@ int usb_msd_device(usb_event_t *event) {
167168
transfer->length = 0;
168169
transfer->status = USB_TRANSFER_COMPLETED;
169170
} else {
171+
gui_console_printf("[MSD] Unhandled control transfer %02X:%02X %04X:%04X\n",
172+
bmRequestType, bRequest, wValue, wIndex);
170173
transfer->buffer = NULL;
171174
transfer->length = 0;
172175
transfer->status = USB_TRANSFER_STALLED;

core/usb/usb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#define CONTROL_MPS 0x40
1717

18-
/* Global GPT state */
1918
usb_state_t usb;
2019

2120
typedef enum usb_qtype {
@@ -244,8 +243,10 @@ static void usb_unplug(void) {
244243
static void usb_plug_complete(void) {
245244
if (usb.device != usb_disconnected_device) {
246245
usb_plug();
246+
sched_set(SCHED_USB, 1);
247247
} else {
248248
usb_unplug();
249+
sched_clear(SCHED_USB);
249250
}
250251
}
251252

0 commit comments

Comments
 (0)