Skip to content

Commit 6e29ad8

Browse files
committed
digicdc speed up! thanks @Defragster
1 parent 7f0e412 commit 6e29ad8

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

hardware/digistump/avr/libraries/DigisparkCDC/DigiCDC.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ and Digistump LLC (digistump.com)
1616

1717
uchar sendEmptyFrame;
1818
static uchar intr3Status; /* used to control interrupt endpoint transmissions */
19-
uint8_t cdcDelay = 45; //9 works if sending short strings only or not using F() - set with setDelay
2019

2120
DigiCDCDevice::DigiCDCDevice(void){}
2221

@@ -40,13 +39,10 @@ void DigiCDCDevice::flush(){
4039
void DigiCDCDevice::begin(){
4140

4241
usbBegin();
42+
DigiCDCDevice::delay(500);//delay to allow enumeration and such
4343

4444
}
45-
void DigiCDCDevice::setDelay(uint8_t delay){
4645

47-
cdcDelay = delay;
48-
49-
}
5046
size_t DigiCDCDevice::write(uint8_t c)
5147
{
5248
if(RingBuffer_IsFull(&txBuf))
@@ -57,7 +53,7 @@ size_t DigiCDCDevice::write(uint8_t c)
5753
else
5854
{
5955
RingBuffer_Insert(&txBuf,c);
60-
DigiCDCDevice::delay(cdcDelay); //ouch its slow but it ensures it will work no matter how long of a string is thrown at it
56+
DigiCDCDevice::delay(5); //gives 4.2-4.7ms per character for usb transfer at low speed
6157
return 1;
6258
}
6359

hardware/digistump/avr/libraries/DigisparkCDC/DigiCDC.h

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class DigiCDCDevice : public Stream {
3838
public:
3939
DigiCDCDevice();
4040
void begin(), begin(unsigned long x);
41-
void setDelay(uint8_t delay);
4241
void end();
4342
void refresh();
4443
void task();

0 commit comments

Comments
 (0)