mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 03:37:40 +00:00
fixed usb serial not working after reconnect (#2196)
* fixed usb serial not working after reconnect * added restart for sd over usb disconnect * improved usb serial fix * fixed formatting
This commit is contained in:
@@ -22,13 +22,23 @@
|
||||
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include <libopencm3/lpc43xx/usb.h>
|
||||
|
||||
extern "C" {
|
||||
void start_usb(void);
|
||||
void irq_usb(void);
|
||||
void usb_transfer(void);
|
||||
|
||||
extern volatile bool scsi_running;
|
||||
|
||||
CH_IRQ_HANDLER(Vector60) {
|
||||
const uint32_t status = USB0_USBSTS_D & USB0_USBINTR_D;
|
||||
if (status & USB0_USBSTS_D_SLI) {
|
||||
// USB reset received.
|
||||
if (scsi_running) {
|
||||
LPC_RGU->RESET_CTRL[0] = (1 << 0);
|
||||
}
|
||||
}
|
||||
irq_usb();
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "sd_over_usb.h"
|
||||
#include "scsi.h"
|
||||
|
||||
bool scsi_running = false;
|
||||
volatile bool scsi_running = false;
|
||||
|
||||
usb_request_status_t report_max_lun(
|
||||
usb_endpoint_t* const endpoint,
|
||||
|
Reference in New Issue
Block a user