mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
Fixed CDC_SERIAL_BUFFER_SIZE macros (PeterVH)
This commit is contained in:
parent
95cadfef12
commit
e72eaa858a
@ -22,6 +22,7 @@ ARDUINO 1.5.2 BETA - 2012.01.23
|
||||
* sam: added CANRX1/CANTX1 pins 88/89 (same physical pin for 66/53)
|
||||
* sam: fixed analogWrite when used in very thight write loops (V.Dorrich)
|
||||
* sam: fixed USBSerial.write() while sending big buffers (Bill Dreschel)
|
||||
* sam: USBSerial receive buffer size is now 512 (PeterVH)
|
||||
|
||||
[libraries]
|
||||
* sam: Added Servo library
|
||||
|
@ -157,7 +157,7 @@ void Serial_::accept(void)
|
||||
{
|
||||
ring_buffer *buffer = &cdc_rx_buffer;
|
||||
uint32_t c = USBD_Recv(CDC_RX);
|
||||
uint32_t i = (uint32_t)(buffer->head+1) % SERIAL_BUFFER_SIZE;
|
||||
uint32_t i = (uint32_t)(buffer->head+1) % CDC_SERIAL_BUFFER_SIZE;
|
||||
|
||||
// if we should be storing the received character into the location
|
||||
// just before the tail (meaning that the head would advance to the
|
||||
@ -172,7 +172,7 @@ void Serial_::accept(void)
|
||||
int Serial_::available(void)
|
||||
{
|
||||
ring_buffer *buffer = &cdc_rx_buffer;
|
||||
return (unsigned int)(SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % SERIAL_BUFFER_SIZE;
|
||||
return (unsigned int)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
int Serial_::peek(void)
|
||||
@ -201,7 +201,7 @@ int Serial_::read(void)
|
||||
else
|
||||
{
|
||||
unsigned char c = buffer->buffer[buffer->tail];
|
||||
buffer->tail = (unsigned int)(buffer->tail + 1) % SERIAL_BUFFER_SIZE;
|
||||
buffer->tail = (unsigned int)(buffer->tail + 1) % CDC_SERIAL_BUFFER_SIZE;
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user