Skip to content

Commit e6f5024

Browse files
committed
Revert "CDC-ACM CODK-M firmware compatibility changes"
This reverts commit dea61b8.
1 parent e958354 commit e6f5024

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cores/arduino/CDCSerialClass.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "wiring_digital.h"
3131
#include "variant.h"
3232

33-
#define CDCACM_FIXED_DELAY 64
3433

3534
extern void CDCSerial_Handler(void);
3635
extern void serialEventRun1(void) __attribute__((weak));
@@ -133,7 +132,7 @@ void CDCSerialClass::flush( void )
133132

134133
size_t CDCSerialClass::write( const uint8_t uc_data )
135134
{
136-
uint32_t retries = 2;
135+
uint32_t retries = 1;
137136

138137
if (!_shared_data->device_open || !_shared_data->host_open)
139138
return(0);
@@ -148,8 +147,9 @@ size_t CDCSerialClass::write( const uint8_t uc_data )
148147
_tx_buffer->data[_tx_buffer->head] = uc_data;
149148
_tx_buffer->head = i;
150149

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);
153153
break;
154154
}
155155
} while (retries--);

0 commit comments

Comments
 (0)