Skip to content

Commit

Permalink
digicdc speed up! thanks @Defragster
Browse files Browse the repository at this point in the history
  • Loading branch information
ekettenburg committed Jan 15, 2015
1 parent 7f0e412 commit 6e29ad8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions hardware/digistump/avr/libraries/DigisparkCDC/DigiCDC.cpp
Expand Up @@ -16,7 +16,6 @@ and Digistump LLC (digistump.com)

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

DigiCDCDevice::DigiCDCDevice(void){}

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

usbBegin();
DigiCDCDevice::delay(500);//delay to allow enumeration and such

}
void DigiCDCDevice::setDelay(uint8_t delay){

cdcDelay = delay;

}
size_t DigiCDCDevice::write(uint8_t c)
{
if(RingBuffer_IsFull(&txBuf))
Expand All @@ -57,7 +53,7 @@ size_t DigiCDCDevice::write(uint8_t c)
else
{
RingBuffer_Insert(&txBuf,c);
DigiCDCDevice::delay(cdcDelay); //ouch its slow but it ensures it will work no matter how long of a string is thrown at it
DigiCDCDevice::delay(5); //gives 4.2-4.7ms per character for usb transfer at low speed
return 1;
}

Expand Down
1 change: 0 additions & 1 deletion hardware/digistump/avr/libraries/DigisparkCDC/DigiCDC.h
Expand Up @@ -38,7 +38,6 @@ class DigiCDCDevice : public Stream {
public:
DigiCDCDevice();
void begin(), begin(unsigned long x);
void setDelay(uint8_t delay);
void end();
void refresh();
void task();
Expand Down

0 comments on commit 6e29ad8

Please sign in to comment.