summaryrefslogtreecommitdiff
path: root/common/case_closed_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/case_closed_debug.c')
-rw-r--r--common/case_closed_debug.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/case_closed_debug.c b/common/case_closed_debug.c
index a1f8522ccd..3adc563c4f 100644
--- a/common/case_closed_debug.c
+++ b/common/case_closed_debug.c
@@ -10,6 +10,7 @@
#include "common.h"
#include "usb_api.h"
#include "usb_console.h"
+#include "usb_spi.h"
#if !defined(CONFIG_USB)
#error "CONFIG_USB must be defined to use Case Closed Debugging"
@@ -23,6 +24,10 @@
#error "CONFIG_USB_INHIBIT_INIT must be defined to use Case Closed Debugging"
#endif
+#if defined(CONFIG_USB_SPI)
+USB_SPI_CONFIG(ccd_usb_spi, USB_IFACE_SPI, USB_EP_SPI);
+#endif
+
static enum ccd_mode current_mode = CCD_MODE_DISABLED;
void ccd_set_mode(enum ccd_mode new_mode)
@@ -41,6 +46,10 @@ void ccd_set_mode(enum ccd_mode new_mode)
*/
usb_console_enable(new_mode == CCD_MODE_ENABLED);
+#if defined(CONFIG_USB_SPI)
+ usb_spi_enable(&ccd_usb_spi, new_mode == CCD_MODE_ENABLED);
+#endif
+
if (new_mode != CCD_MODE_DISABLED)
usb_init();
}