Skip to content

USB CDC: Line Info Per Instance #713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cores/arduino/USB/CDC.cpp
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions cores/arduino/USB/CDC.h
Original file line number Diff line number Diff line change
@@ -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
@@ -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;