Skip to content
Merged
Show file tree
Hide file tree
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
Move lineinfo into class instead of static variable
  • Loading branch information
skulblakka committed Nov 29, 2023
commit d0ae34d293645c0c06fda4b80958924e0fa6f216
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