mirror of
https://github.com/juribeparada/MMDVM_HS.git
synced 2026-04-07 15:23:43 +00:00
Adding Jonathan’s ring buffer to serial repeater
This commit is contained in:
parent
eefda572bf
commit
6486bf4efc
4 changed files with 76 additions and 14 deletions
|
|
@ -112,5 +112,25 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool
|
|||
}
|
||||
}
|
||||
|
||||
int CSerialPort::availableForWriteInt(uint8_t n)
|
||||
{
|
||||
switch (n) {
|
||||
case 1U:
|
||||
#if defined(STM32_USART1_HOST) && defined(__STM32F1__)
|
||||
return Serial1.availableForWrite();
|
||||
#else
|
||||
return Serial.availableForWrite();
|
||||
#endif
|
||||
case 3U:
|
||||
#if defined(SERIAL_REPEATER) && defined(__STM32F1__)
|
||||
return Serial2.availableForWrite();
|
||||
#elif defined(SERIAL_REPEATER) && (defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__))
|
||||
return Serial1.availableForWrite();
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue