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) {
123123 }
124124
125125 static uint64_t last_avail_time;
126- int i = 0 ;
126+ int written = 0 ;
127127 if (tud_cdc_connected ()) {
128128 for (size_t i = 0 ; i < length;) {
129129 int n = length - i;
@@ -136,6 +136,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
136136 tud_task ();
137137 tud_cdc_write_flush ();
138138 i += n2;
139+ written += n2;
139140 last_avail_time = time_us_64 ();
140141 } else {
141142 tud_task ();
@@ -150,7 +151,7 @@ size_t SerialUSB::write(const uint8_t *buf, size_t length) {
150151 // reset our timeout
151152 last_avail_time = 0 ;
152153 }
153- return i ;
154+ return written ;
154155}
155156
156157SerialUSB::operator bool () {
You can’t perform that action at this time.
0 commit comments