File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
123
123
}
124
124
125
125
static uint64_t last_avail_time;
126
- int i = 0 ;
126
+ int written = 0 ;
127
127
if (tud_cdc_connected ()) {
128
128
for (size_t i = 0 ; i < length;) {
129
129
int n = length - i;
@@ -136,6 +136,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
136
136
tud_task ();
137
137
tud_cdc_write_flush ();
138
138
i += n2;
139
+ written += n2;
139
140
last_avail_time = time_us_64 ();
140
141
} else {
141
142
tud_task ();
@@ -150,7 +151,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
150
151
// reset our timeout
151
152
last_avail_time = 0 ;
152
153
}
153
- return i ;
154
+ return written ;
154
155
}
155
156
156
157
SerialUSB::operator bool () {
You can’t perform that action at this time.
0 commit comments