[gnoduino: 232/237] Making head and tail unsigned to avoid division in serial ISR.



commit a18e04c642b91cea30862b51538370765dbc3fab
Author: David A. Mellis <d mellis arduino cc>
Date:   Fri Feb 3 17:24:29 2012 -0500

    Making head and tail unsigned to avoid division in serial ISR.
    
    http://code.google.com/p/arduino/issues/detail?id=776

 arduino/cores/arduino/HardwareSerial.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/arduino/cores/arduino/HardwareSerial.cpp b/arduino/cores/arduino/HardwareSerial.cpp
index 1b1fa71..9985b78 100644
--- a/arduino/cores/arduino/HardwareSerial.cpp
+++ b/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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]