From e1438efb3a6d538ae3fd0e2037ec2b112aa1c563 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Fri, 3 Feb 2012 17:24:29 -0500 Subject: Making head and tail unsigned to avoid division in serial ISR. http://code.google.com/p/arduino/issues/detail?id=776 --- cores/arduino/HardwareSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 1b1fa71..9985b78 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -46,8 +46,8 @@ struct ring_buffer { unsigned char buffer[SERIAL_BUFFER_SIZE]; - volatile int head; - volatile int tail; + volatile unsigned int head; + volatile unsigned int tail; }; #if defined(USBCON) -- cgit v1.2.3-18-g5258