From 915e4889e41b61e2b4b312ca3cddb943cb31487f Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Fri, 3 Feb 2012 17:24:29 -0500 Subject: [PATCH] Making head and tail unsigned to avoid division in serial ISR. http://code.google.com/p/arduino/issues/detail?id=776 --- hardware/arduino/cores/arduino/HardwareSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/cores/arduino/HardwareSerial.cpp b/hardware/arduino/cores/arduino/HardwareSerial.cpp index 1b1fa71d8..9985b78c6 100644 --- a/hardware/arduino/cores/arduino/HardwareSerial.cpp +++ b/hardware/arduino/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)