Skip to content

Commit dea61b8

Browse files
bigdinotechsys_maker
authored andcommitted
CDC-ACM CODK-M firmware compatibility changes
-compatibility changes for CDC-ACM usb serial to work with upcoming CODK-M based firmware -use a fixed delay between writes instead of trying to mimick UART throttling
1 parent 3122781 commit dea61b8

File tree

2 files changed

+4816
-4
lines changed

2 files changed

+4816
-4
lines changed

cores/arduino/CDCSerialClass.cpp

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

33+
#define CDCACM_FIXED_DELAY 64
3334

3435
extern void CDCSerial_Handler(void);
3536
extern void serialEventRun1(void) __attribute__((weak));
@@ -132,7 +133,7 @@ void CDCSerialClass::flush( void )
132133

133134
size_t CDCSerialClass::write( const uint8_t uc_data )
134135
{
135-
uint32_t retries = 1;
136+
uint32_t retries = 2;
136137

137138
if (!_shared_data->device_open || !_shared_data->host_open)
138139
return(0);
@@ -147,9 +148,8 @@ size_t CDCSerialClass::write( const uint8_t uc_data )
147148
_tx_buffer->data[_tx_buffer->head] = uc_data;
148149
_tx_buffer->head = i;
149150

150-
// Mimick the throughput of a typical UART by throttling the data
151-
// flow according to the configured baud rate
152-
delayMicroseconds(_writeDelayUsec);
151+
// Just use a fixed delay to make it compatible with the CODK-M based firmware
152+
delayMicroseconds(CDCACM_FIXED_DELAY);
153153
break;
154154
}
155155
} while (retries--);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy