projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add script reading bootloader flags
[pub/lufa.git]
/
Projects
/
USBtoSerial
/
USBtoSerial.c
diff --git
a/Projects/USBtoSerial/USBtoSerial.c
b/Projects/USBtoSerial/USBtoSerial.c
index
1c791d9
..
d1a8893
100644
(file)
--- a/
Projects/USBtoSerial/USBtoSerial.c
+++ b/
Projects/USBtoSerial/USBtoSerial.c
@@
-1,13
+1,13
@@
/*
LUFA Library
/*
LUFA Library
- Copyright (C) Dean Camera, 20
14
.
+ Copyright (C) Dean Camera, 20
21
.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
- Copyright 20
14
Dean Camera (dean [at] fourwalledcubicle [dot] com)
+ Copyright 20
21
Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
@@
-133,8
+133,8
@@
int main(void)
}
}
}
}
- /* Load the next byte from the USART transmit buffer into the USART */
- if (!(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))
+ /* Load the next byte from the USART transmit buffer into the USART
if transmit buffer space is available
*/
+ if (
Serial_IsSendReady() &&
!(RingBuffer_IsEmpty(&USBtoUSART_Buffer)))
Serial_SendByte(RingBuffer_Remove(&USBtoUSART_Buffer));
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
Serial_SendByte(RingBuffer_Remove(&USBtoUSART_Buffer));
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
@@
-194,7
+194,7
@@
ISR(USART1_RX_vect, ISR_BLOCK)
{
uint8_t ReceivedByte = UDR1;
{
uint8_t ReceivedByte = UDR1;
- if (
USB_DeviceState == DEVICE_STATE_Configured
)
+ if (
(USB_DeviceState == DEVICE_STATE_Configured) && !(RingBuffer_IsFull(&USARTtoUSB_Buffer))
)
RingBuffer_Insert(&USARTtoUSB_Buffer, ReceivedByte);
}
RingBuffer_Insert(&USARTtoUSB_Buffer, ReceivedByte);
}