Skip to content

Commit 0824abf

Browse files
committed
Merge branch 'master' into ide-1.5.x
Conflicts: hardware/arduino/cores/arduino/HardwareSerial.cpp hardware/arduino/cores/robot/Arduino.h
2 parents 549e1d8 + 54a6d64 commit 0824abf

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

build/shared/revisions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ The following changes are included also in the Arduino IDE 1.0.7:
99
[libraries]
1010
* EthernetClien: use IANA recommended ephemeral port range, 49152-65535 (Jack Christensen, cifer-lee)
1111

12+
[core]
13+
* Fixed regression in HardwareSerial::available() introduced with https://github.com/arduino/Arduino/pull/2057
14+
1215
ARDUINO 1.5.8 BETA - 2014.10.01
1316

1417
[ide]
@@ -346,6 +349,10 @@ ARDUINO 1.0.7
346349
* Backported GSM from IDE 1.5.x
347350
* EthernetClien: use IANA recommended ephemeral port range, 49152-65535 (Jack Christensen, cifer-lee)
348351

352+
[core]
353+
* Fixed missing NOT_AN_INTERRUPT constant in digitalPinToInterrupt() macro
354+
* Fixed regression in HardwareSerial::available() introduced with https://github.com/arduino/Arduino/pull/2057
355+
349356
ARDUINO 1.0.6 - 2014.09.16
350357

351358
[core]

hardware/arduino/avr/cores/arduino/HardwareSerial.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void HardwareSerial::end()
152152

153153
int HardwareSerial::available(void)
154154
{
155-
return (int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail) % SERIAL_RX_BUFFER_SIZE;
155+
return ((unsigned int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail)) % SERIAL_RX_BUFFER_SIZE;
156156
}
157157

158158
int HardwareSerial::peek(void)

hardware/arduino/avr/cores/arduino/HardwareSerial.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
// using a ring buffer (I think), in which head is the index of the location
3333
// to which to write the next incoming character and tail is the index of the
3434
// location from which to read.
35+
// NOTE: a "power of 2" buffer size is reccomended to dramatically
36+
// optimize all the modulo operations for ring buffers.
3537
#if !(defined(SERIAL_TX_BUFFER_SIZE) && defined(SERIAL_RX_BUFFER_SIZE))
3638
#if (RAMEND < 1000)
3739
#define SERIAL_TX_BUFFER_SIZE 16

0 commit comments

Comments
 (0)