Arduino 1.6 rc1 Core update
Just a small HW Serial update
This commit is contained in:
parent
5869b838cd
commit
47b6e14961
2 changed files with 3 additions and 1 deletions
|
|
@ -152,7 +152,7 @@ void HardwareSerial::end()
|
|||
|
||||
int HardwareSerial::available(void)
|
||||
{
|
||||
return (int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail) % SERIAL_RX_BUFFER_SIZE;
|
||||
return ((unsigned int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail)) % SERIAL_RX_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
int HardwareSerial::peek(void)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
// using a ring buffer (I think), in which head is the index of the location
|
||||
// to which to write the next incoming character and tail is the index of the
|
||||
// location from which to read.
|
||||
// NOTE: a "power of 2" buffer size is reccomended to dramatically
|
||||
// optimize all the modulo operations for ring buffers.
|
||||
#if !(defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE))
|
||||
#if (RAMEND < 1000)
|
||||
#define SERIAL_TX_BUFFER_SIZE 16
|
||||
|
|
|
|||
Loading…
Reference in a new issue