forked from mfulz_github/qmk_firmware
Reduce prescaler of the flush timer in the USBtoSerial demo, so that buffer overruns will not occur regardless of hardware and baud rate settings.
This commit is contained in:
parent
0bcc82ac28
commit
8de31cbb78
|
@ -124,8 +124,8 @@ void SetupHardware(void)
|
||||||
LEDs_Init();
|
LEDs_Init();
|
||||||
USB_Init();
|
USB_Init();
|
||||||
|
|
||||||
/* Configure the UART flush timer - run at Fcpu/1024 for maximum interval before overflow */
|
/* Start the flush timer so that overflows occur rapidly to push received bytes to the USB interface */
|
||||||
TCCR0B = ((1 << CS02) | (1 << CS00));
|
TCCR0B = (1 << CS02);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Event handler for the library USB Connection event. */
|
/** Event handler for the library USB Connection event. */
|
||||||
|
|
|
@ -124,7 +124,7 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ISR to manage the transmission of bits via the software UART. */
|
/** ISR to manage the transmission of bits via the software UART. */
|
||||||
ISR(TIMER3_COMPA_vect, ISR_NOBLOCK)
|
ISR(TIMER3_COMPA_vect, ISR_BLOCK)
|
||||||
{
|
{
|
||||||
/* Check if transmission has finished */
|
/* Check if transmission has finished */
|
||||||
if (TX_BitsRemaining)
|
if (TX_BitsRemaining)
|
||||||
|
|
Loading…
Reference in New Issue