Bladeren bron

Merge pull request #39 from nickray/no-modem-signaling

Avoid ModemManager blocking the virtual serial port
Dmitry Filimonchuk 7 jaren geleden
bovenliggende
commit
d47340612f
2 gewijzigde bestanden met toevoegingen van 6 en 0 verwijderingen
  1. 5 0
      demo/cdc_loop.c
  2. 1 0
      inc/usb_cdc.h

+ 5 - 0
demo/cdc_loop.c

@@ -35,6 +35,7 @@
 #define CDC_LOOPBACK
 #define ENABLE_HID_COMBO
 
+//#define SIGNAL_MODEM  /* uncomment to signal modem capabilities */
 //#define CDC_USE_IRQ   /* uncomment to build interrupt-based demo */
 
 /* Declaration of the report descriptor */
@@ -124,7 +125,11 @@ static const struct cdc_config config_desc = {
         .bNumEndpoints          = 1,
         .bInterfaceClass        = USB_CLASS_CDC,
         .bInterfaceSubClass     = USB_CDC_SUBCLASS_ACM,
+        #ifdef SIGNAL_MODEM
         .bInterfaceProtocol     = USB_CDC_PROTO_V25TER,
+        #else
+        .bInterfaceProtocol     = USB_CDC_PROTO_NONE,
+        #endif
         .iInterface             = NO_DESCRIPTOR,
     },
     .cdc_hdr = {

+ 1 - 0
inc/usb_cdc.h

@@ -39,6 +39,7 @@
 
 /**\name Communications Class Protocol Codes
  * @{ */
+#define USB_CDC_PROTO_NONE              0x00    /**<\brief No class specific protocol required */
 #define USB_CDC_PROTO_V25TER            0x01    /**<\brief AT Commands: V.250 etc.*/
  /** @} */