Skip to content

Commit 915e488

Browse files
committed
Making head and tail unsigned to avoid division in serial ISR.
http://code.google.com/p/arduino/issues/detail?id=776
1 parent 11281ec commit 915e488

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hardware/arduino/cores/arduino/HardwareSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
struct ring_buffer
4747
{
4848
unsigned char buffer[SERIAL_BUFFER_SIZE];
49-
volatile int head;
50-
volatile int tail;
49+
volatile unsigned int head;
50+
volatile unsigned int tail;
5151
};
5252

5353
#if defined(USBCON)

0 commit comments

Comments
 (0)