Skip to content

Commit

Permalink
Merge pull request #713 from skulblakka/fix/staticUsbLineInfo
Browse files Browse the repository at this point in the history
USB CDC: Line Info Per Instance
  • Loading branch information
facchinm authored Nov 30, 2023
2 parents 84c09b3 + d0ae34d commit eaf7756
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 0 additions & 16 deletions cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@ extern USBDevice_SAMD21G18x usbd;

extern USBDeviceClass USBDevice;

typedef struct {
uint32_t dwDTERate;
uint8_t bCharFormat;
uint8_t bParityType;
uint8_t bDataBits;
uint8_t lineState;
} LineInfo;

static volatile LineInfo _usbLineInfo = {
115200, // dWDTERate
0x00, // bCharFormat
0x00, // bParityType
0x08, // bDataBits
0x00 // lineState
};

static volatile int32_t breakValue = -1;

// CDC
Expand Down
8 changes: 8 additions & 0 deletions cores/arduino/USB/CDC.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ typedef struct
EndpointDescriptor out;
} CDCDescriptor;

typedef struct {
uint32_t dwDTERate;
uint8_t bCharFormat;
uint8_t bParityType;
uint8_t bDataBits;
uint8_t lineState;
} LineInfo;


#endif
#endif
8 changes: 8 additions & 0 deletions cores/arduino/USB/USBAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ friend USBDeviceClass;
bool stalled;
unsigned int epType[3];

volatile LineInfo _usbLineInfo = {
115200, // dWDTERate
0x00, // bCharFormat
0x00, // bParityType
0x08, // bDataBits
0x00 // lineState
};

};
extern Serial_ SerialUSB;

Expand Down

0 comments on commit eaf7756

Please sign in to comment.