Bläddra i källkod

Merge pull request #510 from KurtE/T4-HardwareSerial-addMemory-fix

Update HardwareSerial.cpp
main
Paul Stoffregen 4 år sedan
förälder
incheckning
c559d1aaa3
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 10 tillägg och 4 borttagningar
  1. +10
    -4
      teensy4/HardwareSerial.cpp

+ 10
- 4
teensy4/HardwareSerial.cpp Visa fil

@@ -427,11 +427,14 @@ void HardwareSerial::addMemoryForRead(void *buffer, size_t length)
{
rx_buffer_storage_ = (BUFTYPE*)buffer;
if (buffer) {
rx_buffer_total_size_ = rx_buffer_total_size_ + length;
rx_buffer_total_size_ = rx_buffer_size_ + length;
} else {
rx_buffer_total_size_ = rx_buffer_total_size_;
rx_buffer_total_size_ = rx_buffer_size_;
}

// Make sure we don't end up indexing into no mans land.
rx_buffer_head_ = 0;
rx_buffer_tail_ = 0;
rts_low_watermark_ = rx_buffer_total_size_ - hardware->rts_low_watermark;
rts_high_watermark_ = rx_buffer_total_size_ - hardware->rts_high_watermark;
}
@@ -440,10 +443,13 @@ void HardwareSerial::addMemoryForWrite(void *buffer, size_t length)
{
tx_buffer_storage_ = (BUFTYPE*)buffer;
if (buffer) {
tx_buffer_total_size_ = tx_buffer_total_size_ + length;
tx_buffer_total_size_ = tx_buffer_size_ + length;
} else {
tx_buffer_total_size_ = tx_buffer_total_size_;
tx_buffer_total_size_ = tx_buffer_size_;
}
// Make sure we don't end up indexing into no mans land.
tx_buffer_head_ = 0;
tx_buffer_tail_ = 0;
}

int HardwareSerial::peek(void)

Laddar…
Avbryt
Spara