digicdc speed up! thanks @defragster

This commit is contained in:
Erik Tylek Kettenburg 2015-01-15 14:43:55 -08:00
parent 7f0e4124e0
commit 6e29ad8d17
2 changed files with 2 additions and 7 deletions

View File

@ -16,7 +16,6 @@ and Digistump LLC (digistump.com)
uchar sendEmptyFrame; uchar sendEmptyFrame;
static uchar intr3Status; /* used to control interrupt endpoint transmissions */ 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){} DigiCDCDevice::DigiCDCDevice(void){}
@ -40,13 +39,10 @@ void DigiCDCDevice::flush(){
void DigiCDCDevice::begin(){ void DigiCDCDevice::begin(){
usbBegin(); 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) size_t DigiCDCDevice::write(uint8_t c)
{ {
if(RingBuffer_IsFull(&txBuf)) if(RingBuffer_IsFull(&txBuf))
@ -57,7 +53,7 @@ size_t DigiCDCDevice::write(uint8_t c)
else else
{ {
RingBuffer_Insert(&txBuf,c); 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; return 1;
} }

View File

@ -38,7 +38,6 @@ class DigiCDCDevice : public Stream {
public: public:
DigiCDCDevice(); DigiCDCDevice();
void begin(), begin(unsigned long x); void begin(), begin(unsigned long x);
void setDelay(uint8_t delay);
void end(); void end();
void refresh(); void refresh();
void task(); void task();