Skip to content

Commit

Permalink
fix usb kinda
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Oct 2, 2024
1 parent 7018586 commit 6172664
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/usb/msd.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "device.h"

#include "../os/os.h"
#include "../emu.h"

#include <errno.h>
#include <stdbool.h>
Expand Down Expand Up @@ -167,6 +168,8 @@ int usb_msd_device(usb_event_t *event) {
transfer->length = 0;
transfer->status = USB_TRANSFER_COMPLETED;
} else {
gui_console_printf("[MSD] Unhandled control transfer %02X:%02X %04X:%04X\n",
bmRequestType, bRequest, wValue, wIndex);
transfer->buffer = NULL;
transfer->length = 0;
transfer->status = USB_TRANSFER_STALLED;
Expand Down
3 changes: 2 additions & 1 deletion core/usb/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#define CONTROL_MPS 0x40

/* Global GPT state */
usb_state_t usb;

typedef enum usb_qtype {
Expand Down Expand Up @@ -244,8 +243,10 @@ static void usb_unplug(void) {
static void usb_plug_complete(void) {
if (usb.device != usb_disconnected_device) {
usb_plug();
sched_set(SCHED_USB, 1);
} else {
usb_unplug();
sched_clear(SCHED_USB);
}
}

Expand Down

0 comments on commit 6172664

Please sign in to comment.