mirror of
https://github.com/digistump/DigistumpArduino.git
synced 2025-04-27 23:29:01 -07:00
Update DigiCDC.cpp
make delay configurable
This commit is contained in:
parent
d56454e098
commit
a83f085330
@ -16,7 +16,7 @@ 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){}
|
||||||
|
|
||||||
@ -41,6 +41,11 @@ void DigiCDCDevice::begin(){
|
|||||||
|
|
||||||
usbBegin();
|
usbBegin();
|
||||||
|
|
||||||
|
}
|
||||||
|
void DigiCDCDevice::setDelay(uint8_t delay){
|
||||||
|
|
||||||
|
cdcDelay = delay;
|
||||||
|
|
||||||
}
|
}
|
||||||
size_t DigiCDCDevice::write(uint8_t c)
|
size_t DigiCDCDevice::write(uint8_t c)
|
||||||
{
|
{
|
||||||
@ -52,7 +57,7 @@ size_t DigiCDCDevice::write(uint8_t c)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
RingBuffer_Insert(&txBuf,c);
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,4 +389,4 @@ void usbFunctionWriteOut( uchar *data, uchar len )
|
|||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DigiCDCDevice SerialUSB;
|
DigiCDCDevice SerialUSB;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user