File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 30
30
#include " wiring_digital.h"
31
31
#include " variant.h"
32
32
33
- #define CDCACM_FIXED_DELAY 64
34
33
35
34
extern void CDCSerial_Handler (void );
36
35
extern void serialEventRun1 (void ) __attribute__((weak));
@@ -133,7 +132,7 @@ void CDCSerialClass::flush( void )
133
132
134
133
size_t CDCSerialClass::write ( const uint8_t uc_data )
135
134
{
136
- uint32_t retries = 2 ;
135
+ uint32_t retries = 1 ;
137
136
138
137
if (!_shared_data->device_open || !_shared_data->host_open )
139
138
return (0 );
@@ -148,8 +147,9 @@ size_t CDCSerialClass::write( const uint8_t uc_data )
148
147
_tx_buffer->data [_tx_buffer->head ] = uc_data;
149
148
_tx_buffer->head = i;
150
149
151
- // Just use a fixed delay to make it compatible with the CODK-M based firmware
152
- delayMicroseconds (CDCACM_FIXED_DELAY);
150
+ // Mimick the throughput of a typical UART by throttling the data
151
+ // flow according to the configured baud rate
152
+ delayMicroseconds (_writeDelayUsec);
153
153
break ;
154
154
}
155
155
} while (retries--);
You can’t perform that action at this time.
0 commit comments