File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
digistump-avr/libraries/DigisparkCDC Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,13 @@ and Digistump LLC (digistump.com)
16
16
17
17
uchar sendEmptyFrame;
18
18
static uchar intr3Status; /* used to control interrupt endpoint transmissions */
19
+ static volatile union {
20
+ uchar u8 ;
21
+ struct {
22
+ bool dtr: 1 ;
23
+ bool rts: 1 ;
24
+ } name;
25
+ } controlLines;
19
26
20
27
DigiCDCDevice::DigiCDCDevice (void ){}
21
28
@@ -79,6 +86,17 @@ int DigiCDCDevice::read()
79
86
return RingBuffer_Remove (&rxBuf);
80
87
}
81
88
89
+
90
+ }
91
+
92
+ bool DigiCDCDevice::getDTR ()
93
+ {
94
+ return controlLines.name .dtr ;
95
+ }
96
+
97
+ bool DigiCDCDevice::getRTS ()
98
+ {
99
+ return controlLines.name .rts ;
82
100
}
83
101
84
102
int DigiCDCDevice::peek ()
@@ -325,6 +343,7 @@ usbRequest_t *rq = (usbRequest_t*)((void *)data);
325
343
*/
326
344
if ( intr3Status==0 )
327
345
intr3Status = 2 ;
346
+ controlLines.u8 = rq->wValue .word ;
328
347
}
329
348
330
349
/* Prepare bulk-in endpoint to respond to early termination */
Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ class DigiCDCDevice : public Stream {
45
45
virtual int available (void );
46
46
virtual int peek (void );
47
47
virtual int read (void );
48
+ virtual bool getDTR (void );
49
+ virtual bool getRTS (void );
48
50
virtual void flush (void );
49
51
virtual size_t write (uint8_t );
50
52
using Print::write;
You can’t perform that action at this time.
0 commit comments