Skip to content

Commit eaf7756

Browse files
authored
Merge pull request #713 from skulblakka/fix/staticUsbLineInfo
USB CDC: Line Info Per Instance
2 parents 84c09b3 + d0ae34d commit eaf7756

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,6 @@ extern USBDevice_SAMD21G18x usbd;
4242

4343
extern USBDeviceClass USBDevice;
4444

45-
typedef struct {
46-
uint32_t dwDTERate;
47-
uint8_t bCharFormat;
48-
uint8_t bParityType;
49-
uint8_t bDataBits;
50-
uint8_t lineState;
51-
} LineInfo;
52-
53-
static volatile LineInfo _usbLineInfo = {
54-
115200, // dWDTERate
55-
0x00, // bCharFormat
56-
0x00, // bParityType
57-
0x08, // bDataBits
58-
0x00 // lineState
59-
};
60-
6145
static volatile int32_t breakValue = -1;
6246

6347
// CDC

cores/arduino/USB/CDC.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ typedef struct
7373
EndpointDescriptor out;
7474
} CDCDescriptor;
7575

76+
typedef struct {
77+
uint32_t dwDTERate;
78+
uint8_t bCharFormat;
79+
uint8_t bParityType;
80+
uint8_t bDataBits;
81+
uint8_t lineState;
82+
} LineInfo;
83+
7684

7785
#endif
7886
#endif

cores/arduino/USB/USBAPI.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ friend USBDeviceClass;
176176
bool stalled;
177177
unsigned int epType[3];
178178

179+
volatile LineInfo _usbLineInfo = {
180+
115200, // dWDTERate
181+
0x00, // bCharFormat
182+
0x00, // bParityType
183+
0x08, // bDataBits
184+
0x00 // lineState
185+
};
186+
179187
};
180188
extern Serial_ SerialUSB;
181189

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy