diff options
author | Cristian Maglie <c.maglie@bug.st> | 2014-04-01 17:19:54 +0200 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2014-04-01 17:19:54 +0200 |
commit | c3cfe6b368aa7c2a55d6f4acad2c58f0404ce55d (patch) | |
tree | 571daf897bdbe3489dacf5d55e46074d4d975e3a /cores/arduino/HardwareSerial.cpp | |
parent | 0099416ea46a0ff29b3d9b5612bcc2f87d0198d2 (diff) | |
parent | 9769bac51b126d534be75676aa8b96fa9233ccca (diff) |
Merge commit '1ad74' into ide-1.5.x
Diffstat (limited to 'cores/arduino/HardwareSerial.cpp')
-rw-r--r-- | cores/arduino/HardwareSerial.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index d91026a..e165136 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -83,7 +83,7 @@ void HardwareSerial::_tx_udr_empty_irq(void) // If interrupts are enabled, there must be more data in the output // buffer. Send the next byte unsigned char c = _tx_buffer[_tx_buffer_tail]; - _tx_buffer_tail = (_tx_buffer_tail + 1) % SERIAL_BUFFER_SIZE; + _tx_buffer_tail = (_tx_buffer_tail + 1) % SERIAL_TX_BUFFER_SIZE; *_udr = c; @@ -152,7 +152,7 @@ void HardwareSerial::end() int HardwareSerial::available(void) { - return (unsigned int)(SERIAL_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail) % SERIAL_BUFFER_SIZE; + return (unsigned int)(SERIAL_RX_BUFFER_SIZE + _rx_buffer_head - _rx_buffer_tail) % SERIAL_RX_BUFFER_SIZE; } int HardwareSerial::peek(void) @@ -171,7 +171,7 @@ int HardwareSerial::read(void) return -1; } else { unsigned char c = _rx_buffer[_rx_buffer_tail]; - _rx_buffer_tail = (uint8_t)(_rx_buffer_tail + 1) % SERIAL_BUFFER_SIZE; + _rx_buffer_tail = (rx_buffer_index_t)(_rx_buffer_tail + 1) % SERIAL_RX_BUFFER_SIZE; return c; } } @@ -207,7 +207,7 @@ size_t HardwareSerial::write(uint8_t c) sbi(*_ucsra, TXC0); return 1; } - uint8_t i = (_tx_buffer_head + 1) % SERIAL_BUFFER_SIZE; + tx_buffer_index_t i = (_tx_buffer_head + 1) % SERIAL_TX_BUFFER_SIZE; // If the output buffer is full, there's nothing for it other than to // wait for the interrupt handler to empty it a bit |