diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2012-02-03 17:24:29 -0500 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2012-02-03 17:24:29 -0500 |
commit | e1438efb3a6d538ae3fd0e2037ec2b112aa1c563 (patch) | |
tree | 387d3846e4647784ff4c1c1dc4be54258988fe15 /cores/arduino/HardwareSerial.cpp | |
parent | dd5bae59df6f1ba63083361ba284f364bc62b401 (diff) |
Making head and tail unsigned to avoid division in serial ISR.
http://code.google.com/p/arduino/issues/detail?id=776
Diffstat (limited to 'cores/arduino/HardwareSerial.cpp')
-rw-r--r-- | cores/arduino/HardwareSerial.cpp | 4 |
1 files 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) |