Update DigiCDC.cpp

make delay configurable
This commit is contained in:
Erik Tylek Kettenburg 2015-01-14 21:39:48 -08:00
parent d56454e098
commit a83f085330

View File

@ -16,7 +16,7 @@ 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){}
@ -41,6 +41,11 @@ void DigiCDCDevice::begin(){
usbBegin();
}
void DigiCDCDevice::setDelay(uint8_t delay){
cdcDelay = delay;
}
size_t DigiCDCDevice::write(uint8_t c)
{
@ -52,7 +57,7 @@ size_t DigiCDCDevice::write(uint8_t c)
else
{
RingBuffer_Insert(&txBuf,c);
DigiCDCDevice::delay(45); //ouch its slow but it ensures it will work no matter how long of a string is thrown at it
DigiCDCDevice::delay(cdcDelay); //ouch its slow but it ensures it will work no matter how long of a string is thrown at it
return 1;
}
@ -384,4 +389,4 @@ void usbFunctionWriteOut( uchar *data, uchar len )
} // extern "C"
#endif
DigiCDCDevice SerialUSB;
DigiCDCDevice SerialUSB;